diff --git a/packages/sui-bundler/package.json b/packages/sui-bundler/package.json index 3b3aac52a..6be030bf7 100644 --- a/packages/sui-bundler/package.json +++ b/packages/sui-bundler/package.json @@ -22,6 +22,7 @@ "homepage": "https://github.com/SUI-Components/sui/tree/master/packages/sui-bundler#readme", "dependencies": { "@babel/core": "7.18.10", + "@pmmmwh/react-refresh-webpack-plugin": "0.5.10", "@s-ui/helpers": "1", "@s-ui/sass-loader": "1", "address": "1.2.2", @@ -38,10 +39,12 @@ "find-free-ports": "3.0.0", "html-webpack-plugin": "5.5.0", "https-browserify": "1.0.0", + "million": "3.0.3", "mini-css-extract-plugin": "2.7.7", "postcss": "8.4.31", "postcss-loader": "7.3.4", "process": "0.11.10", + "react-refresh": "0.14.0", "sass": "1.54.5", "stream-http": "3.2.0", "strip-ansi": "6.0.1", @@ -50,8 +53,6 @@ "webpack": "5.82.1", "webpack-dev-server": "4.10.0", "webpack-manifest-plugin": "5.0.0", - "webpack-node-externals": "3.0.0", - "@pmmmwh/react-refresh-webpack-plugin": "0.5.10", - "react-refresh": "0.14.0" + "webpack-node-externals": "3.0.0" } } diff --git a/packages/sui-bundler/webpack.config.prod.js b/packages/sui-bundler/webpack.config.prod.js index 7e81eebca..658584e22 100644 --- a/packages/sui-bundler/webpack.config.prod.js +++ b/packages/sui-bundler/webpack.config.prod.js @@ -3,6 +3,7 @@ /* eslint-disable no-console */ const webpack = require('webpack') const path = require('path') +const million = require('million/compiler') const HtmlWebpackPlugin = require('html-webpack-plugin') const {WebpackManifestPlugin} = require('webpack-manifest-plugin') @@ -100,7 +101,8 @@ const webpackConfig = { template: './index.html' }), new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/runtime/]), - new WebpackManifestPlugin({fileName: 'asset-manifest.json'}) + new WebpackManifestPlugin({fileName: 'asset-manifest.json'}), + million.webpack({auto: true}) ]), module: { rules: cleanList([ diff --git a/packages/sui-bundler/webpack.config.server.js b/packages/sui-bundler/webpack.config.server.js index 515b4515b..d6d0a7067 100644 --- a/packages/sui-bundler/webpack.config.server.js +++ b/packages/sui-bundler/webpack.config.server.js @@ -1,5 +1,6 @@ const webpack = require('webpack') const webpackNodeExternals = require('webpack-node-externals') +const million = require('million/compiler') const path = require('path') const {config, when, cleanList} = require('./shared/index.js') @@ -44,7 +45,7 @@ const webpackConfig = { compression: !isProduction ? 'gzip' : false }, externals: [webpackNodeExternals()], - plugins: [new webpack.DefinePlugin({'global.GENTLY': false})], + plugins: [new webpack.DefinePlugin({'global.GENTLY': false}), million.webpack({auto: true})], resolveLoader, module: { rules: cleanList([