diff --git a/build/webpack.base.config.js b/build/webpack.base.config.js index a5bed32..8612257 100644 --- a/build/webpack.base.config.js +++ b/build/webpack.base.config.js @@ -36,6 +36,7 @@ options: { css: 'css-loader', 'scss': 'css-loader|sass-loader' + // extractCSS: true //don't want to do this when doing server side rendering } }, { diff --git a/build/webpack.client.config.js b/build/webpack.client.config.js index 9aa8966..a5d4447 100644 --- a/build/webpack.client.config.js +++ b/build/webpack.client.config.js @@ -1,8 +1,21 @@ const base = require('./webpack.base.config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') //extends the base config object and include the new property plugins const config = Object.assign({}, base, { plugins: base.plugins || [] }) +// We are using this because base config will be used for server side rendering +// but we don't need to extractCSS in that process only in our dev process + +config.module.rules + .filter(x => { return x.loader == 'vue-loader'}) + .forEach( x=> x.options.extractCSS = true) + +config.plugins.push( + // This plugin accepts the file in which we want to save our styles + new ExtractTextPlugin('assets/styles.css') +) + module.exports = config diff --git a/index.html b/index.html index 16e6d6a..0f7b3b3 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@