summaryrefslogtreecommitdiff
path: root/webpack.config.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2018-05-21 17:22:09 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2018-12-13 16:59:36 +0100
commitdd0af4570e56744ae1ca9264e63041fd5bbe10ba (patch)
treee85b84ff0e6e53ee9c46903a9330ed327cb806b3 /webpack.config.js
parentd05b01c959f37665d54f809274536d27fc251bf4 (diff)
downloadbrokentalents-dd0af4570e56744ae1ca9264e63041fd5bbe10ba.tar.gz
brokentalents-dd0af4570e56744ae1ca9264e63041fd5bbe10ba.zip
Split CSS and JS, build
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/webpack.config.js b/webpack.config.js
index dd690ce..a33084c 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,5 +1,7 @@
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
+const MiniCssExtractPlugin = require('mini-css-extract-plugin');
+const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
module.exports = {
entry: __dirname + '/src/index.js',
@@ -19,7 +21,9 @@ module.exports = {
}, {
test: /\.(css|scss)$/,
use: [
- 'vue-style-loader',
+ process.env.NODE_ENV !== 'production'
+ ? 'vue-style-loader'
+ : MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
],
@@ -34,5 +38,8 @@ module.exports = {
new HtmlWebpackPlugin ({
template: 'src/index.html',
}),
+ new MiniCssExtractPlugin({
+ }),
+ new OptimizeCssAssetsPlugin(),
],
};