diff --git a/lib/webpack/shared.cjs b/lib/webpack/shared.cjs --- a/lib/webpack/shared.cjs +++ b/lib/webpack/shared.cjs @@ -1,3 +1,4 @@ +const { VanillaExtractPlugin } = require('@vanilla-extract/webpack-plugin'); const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); @@ -77,6 +78,7 @@ name: 'browser', optimization: { minimizer: [new TerserPlugin(), new OptimizeCssAssetsPlugin()], + sideEffects: true, }, plugins: [ ...(baseConfig.plugins ?? []), @@ -102,6 +104,7 @@ BROWSER: true, }, }), + new VanillaExtractPlugin(), new MiniCssExtractPlugin({ filename: 'prod.[contenthash:12].build.css', }), @@ -142,7 +145,8 @@ options: { ...cssLoader.options, url: false, - modules: false, + modules: true, + sourceMap: true, }, }, ],