aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/webpack.config.prod.js
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-08-24 22:24:32 +0800
committercrupest <crupest@outlook.com>2020-08-24 22:24:32 +0800
commitf7b5ebbf08704c4e188df8c3a4e4a6985ed52ec9 (patch)
tree0db69b587fbd36733a93a21e135abeeea7ad6b4c /Timeline/ClientApp/webpack.config.prod.js
parent1a99cb1c4fd8b06c0b7dcc3ec85505c632b3bbc3 (diff)
downloadtimeline-f7b5ebbf08704c4e188df8c3a4e4a6985ed52ec9.tar.gz
timeline-f7b5ebbf08704c4e188df8c3a4e4a6985ed52ec9.tar.bz2
timeline-f7b5ebbf08704c4e188df8c3a4e4a6985ed52ec9.zip
Use mini-css-extract-plugin in production.
Diffstat (limited to 'Timeline/ClientApp/webpack.config.prod.js')
-rw-r--r--Timeline/ClientApp/webpack.config.prod.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/Timeline/ClientApp/webpack.config.prod.js b/Timeline/ClientApp/webpack.config.prod.js
index e3ef65e1..5a83a3b8 100644
--- a/Timeline/ClientApp/webpack.config.prod.js
+++ b/Timeline/ClientApp/webpack.config.prod.js
@@ -2,6 +2,7 @@ const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin');
+const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const config = require('./webpack.common');
@@ -11,8 +12,24 @@ config
.entry('index')
.add(path.resolve(__dirname, 'src/app/service-worker.tsx'));
+config.module
+ .rule('css')
+ .use('mini-css-extract')
+ .before('css')
+ .loader(MiniCssExtractPlugin.loader)
+ .end();
+
+config.module
+ .rule('sass')
+ .use('mini-css-extract')
+ .before('css')
+ .loader(MiniCssExtractPlugin.loader)
+ .end();
+
config.devtool('source-map');
+config.plugin('mini-css-extract').use(MiniCssExtractPlugin);
+
config.plugin('clean').use(CleanWebpackPlugin);
config.plugin('copy').use(CopyPlugin, [