diff options
Diffstat (limited to 'config/webpack.prod.js')
| -rw-r--r-- | config/webpack.prod.js | 45 | 
1 files changed, 45 insertions, 0 deletions
| diff --git a/config/webpack.prod.js b/config/webpack.prod.js new file mode 100644 index 0000000..f97fd65 --- /dev/null +++ b/config/webpack.prod.js @@ -0,0 +1,45 @@ +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, +          }, +          '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()], +}; | 
