diff --git a/src/main.js b/src/main.js
index 64316eb..23f8e81 100644
--- a/src/main.js
+++ b/src/main.js
@@ -3,8 +3,6 @@
import Vue from 'vue';
import App from './App.vue';
-document.body.removeAttribute('style');
-
new Vue({
el: '#app',
render: h => h(App)
diff --git a/webpack.config.js b/webpack.config.js
index e83e02f..6e3ad15 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,5 +1,7 @@
const path = require('path');
const webpack = require('webpack');
+const ExtractTextPlugin = require('extract-text-webpack-plugin');
+const PrerenderSpaPlugin = require('prerender-spa-plugin');
module.exports = {
entry: {
@@ -14,7 +16,8 @@ module.exports = {
rules: [
{
test: /\.vue$/,
- loader: 'vue-loader'
+ loader: 'vue-loader',
+ options: {extractCSS: process.env.NODE_ENV === 'production'}
},
{
test: /vanity\.js$/,
@@ -64,6 +67,7 @@ module.exports = {
if (process.env.NODE_ENV === 'production') {
// http://vue-loader.vuejs.org/en/workflow/production.html
module.exports.plugins = (module.exports.plugins || []).concat([
+ new ExtractTextPlugin('style.css'),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
@@ -72,6 +76,15 @@ if (process.env.NODE_ENV === 'production') {
}),
new webpack.LoaderOptionsPlugin({
minimize: true
+ }),
+ new PrerenderSpaPlugin({
+ staticDir: path.join(__dirname),
+ routes: ['/'],
+ minify: {
+ collapseBooleanAttributes: true,
+ decodeEntities: true,
+ sortAttributes: true
+ }
})
]);
}