chore: this works!

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-03-22 16:50:08 +01:00
parent 1a54275cdb
commit 008dbb4498
4 changed files with 34 additions and 249 deletions
+1 -1
View File
@@ -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",
+12 -13
View File
@@ -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,
+2 -1
View File
@@ -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({