From 35413607c62f2de2a90941d487b7964b5c213999 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Tue, 4 Apr 2023 18:45:18 +0530 Subject: Arranging shared modules in the scripts in order to make sure that the dependencies are available when shared modules references each other. --- config/webpack.config.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'config/webpack.config.js') diff --git a/config/webpack.config.js b/config/webpack.config.js index 98315b0..15cae74 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -153,6 +153,8 @@ const injectedBeforeScriptConfiguration = merge( } ); +const sortedSharedModules = [] + const sharedModulesConfiguration = merge( commonOptions, sharedModuleOptions, @@ -160,10 +162,23 @@ const sharedModulesConfiguration = merge( entry: sharedModuleEntries, plugins: [ new CreateManifestPlugin({ - sharedModulesImportedCount + sharedModulesImportedCount, + sortedSharedModules }), new CreateRulesPlugin() - ] + ], + module: { + rules: [ + { + test: /\.(j|t)s$/, + loader: path.resolve(CONFIG_DIR, "webpack/loader/arrange-shared-module-loader.js"), + options: { + sortedSharedModules + }, + enforce: "post" + } + ] + } } ); -- cgit v1.2.3