From 815b190d28cc42e6f3d44d04e1f1ebaea9208cf6 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sat, 30 Oct 2021 22:44:55 +0200 Subject: chore: convert html files to php Now I can use php to determine current env and load static CSS file if it is prod. --- config/webpack/webpack.prod.js | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 config/webpack/webpack.prod.js (limited to 'config/webpack/webpack.prod.js') 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()], +}; -- cgit v1.2.3