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 @@ Vuejs SPA +
diff --git a/package.json b/package.json index 5d85b1d..7084826 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "eslint-plugin-node": "^5.1.1", "eslint-plugin-promise": "^3.5.0", "eslint-plugin-standard": "^3.0.1", + "extract-text-webpack-plugin": "^3.0.2", "node-sass": "^4.7.1", "sass-loader": "^6.0.6", "vue-loader": "^13.5.0", diff --git a/src/app.js b/src/app.js index 5ba6038..ff9ef0d 100644 --- a/src/app.js +++ b/src/app.js @@ -7,7 +7,7 @@ const app = new Vue({ render: h => h(AppLayout) // Because fucktards in javascript want to make everything fucking insane // we are going to use the "spread" - // ...AppLayout + // ...AppLayout //this part didn't work. I don't know why but }) export { app } diff --git a/src/theme/Category.vue b/src/theme/Category.vue index e7e1711..ce7e639 100644 --- a/src/theme/Category.vue +++ b/src/theme/Category.vue @@ -1,20 +1,21 @@ +