@@ -121,7 +121,7 @@
|
||||
"tar": "^6.1.2",
|
||||
"terser-webpack-plugin": "^5.1.3",
|
||||
"util": "^0.12.3",
|
||||
"webpack": "^5.66.0",
|
||||
"webpack": "^5.70.0",
|
||||
"webpack-dev-server": "^4.7.3",
|
||||
"webpack-node-externals": "^3.0.0",
|
||||
"yaml": "^2.0.0",
|
||||
|
||||
@@ -183,11 +183,12 @@ export async function createConfig(
|
||||
},
|
||||
plugins: [
|
||||
new LinkedPackageResolvePlugin(paths.rootNodeModules, externalPkgs),
|
||||
new ModuleScopePlugin(
|
||||
[paths.targetSrc, paths.targetDev],
|
||||
[paths.targetPackageJson],
|
||||
),
|
||||
],
|
||||
!isDev &&
|
||||
new ModuleScopePlugin(
|
||||
[paths.targetSrc, paths.targetDev],
|
||||
[paths.targetPackageJson],
|
||||
),
|
||||
].filter(Boolean),
|
||||
alias: resolveAliases,
|
||||
},
|
||||
module: {
|
||||
@@ -277,14 +278,12 @@ export async function createBackendConfig(
|
||||
modules: [paths.rootNodeModules, ...moduleDirs],
|
||||
plugins: [
|
||||
new LinkedPackageResolvePlugin(paths.rootNodeModules, externalPkgs),
|
||||
new ModuleScopePlugin(
|
||||
[paths.targetSrc, paths.targetDev],
|
||||
[paths.targetPackageJson],
|
||||
),
|
||||
],
|
||||
alias: {
|
||||
'react-dom': '@hot-loader/react-dom',
|
||||
},
|
||||
!isDev &&
|
||||
new ModuleScopePlugin(
|
||||
[paths.targetSrc, paths.targetDev],
|
||||
[paths.targetPackageJson],
|
||||
),
|
||||
].filter(Boolean),
|
||||
},
|
||||
module: {
|
||||
rules: loaders,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ModuleOptions, WebpackPluginInstance } from 'webpack';
|
||||
import webpack, { ModuleOptions, WebpackPluginInstance } from 'webpack';
|
||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
||||
import { svgrTemplate } from '../svgrTemplate';
|
||||
import ReactRefreshPlugin from '@pmmmwh/react-refresh-webpack-plugin';
|
||||
@@ -181,6 +181,7 @@ export const transforms = (options: TransformOptions): Transforms => {
|
||||
|
||||
if (isDev) {
|
||||
plugins.push(new ReactRefreshPlugin());
|
||||
// plugins.push(new webpack.HotModuleReplacementPlugin());
|
||||
} else {
|
||||
plugins.push(
|
||||
new MiniCssExtractPlugin({
|
||||
|
||||
Reference in New Issue
Block a user