aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack/webpack.prod.js
diff options
context:
space:
mode:
Diffstat (limited to 'config/webpack/webpack.prod.js')
-rw-r--r--config/webpack/webpack.prod.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/config/webpack/webpack.prod.js b/config/webpack/webpack.prod.js
new file mode 100644
index 0000000..a2778f5
--- /dev/null
+++ b/config/webpack/webpack.prod.js
@@ -0,0 +1,48 @@
+const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
+const MiniCssExtractPlugin = require('mini-css-extract-plugin');
+const dartSass = require('sass');
+const paths = require('./paths');
+
+module.exports = {
+ mode: 'production',
+ devtool: false,
+ optimization: {
+ minimizer: [new CssMinimizerPlugin(), '...'],
+ },
+ module: {
+ rules: [
+ {
+ test: /\.(sa|sc|c)ss$/i,
+ use: [
+ {
+ loader: MiniCssExtractPlugin.loader,
+ options: {
+ publicPath: '../',
+ },
+ },
+ 'css-loader',
+ {
+ loader: 'postcss-loader',
+ options: {
+ postcssOptions: {
+ plugins: ['autoprefixer'],
+ },
+ },
+ },
+ {
+ loader: 'sass-loader',
+ options: {
+ implementation: dartSass,
+ sassOptions: {
+ indentWidth: 2,
+ outputStyle: 'compressed',
+ includePaths: paths.sassPaths,
+ },
+ },
+ },
+ ],
+ },
+ ],
+ },
+ plugins: [new MiniCssExtractPlugin()],
+};