mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 15:43:13 +09:00
Share each individual lib import webpack config
The module sharing in Webpack works on a per import basis and therefore doesn't trigger when the value in the config is @clusterio/lib while the module imported is @clusterio/lib/config. This in turn caused a copy of lib to be bundled with each plugin. Fix by making sure each lib import is shared and specified in the configs.
This commit is contained in:
1 parent
fe9cef5e1e
commit
b814d8a400
5 files changed
+16
-5
No files matched your search
@@ -19,7 +19,14 @@ module.exports = (env = {}) => merge(common(env), {
|
|||||||
new webpack.container.ModuleFederationPlugin({
|
new webpack.container.ModuleFederationPlugin({
|
||||||
name: "master",
|
name: "master",
|
||||||
shared: {
|
shared: {
|
||||||
"@clusterio/lib": { singleton: true },
|
"@clusterio/lib/config": { singleton: true },
|
||||||
|
"@clusterio/lib/errors": { singleton: true },
|
||||||
|
"@clusterio/lib/helpers": { singleton: true },
|
||||||
|
"@clusterio/lib/link": { singleton: true },
|
||||||
|
"@clusterio/lib/logging": { singleton: true },
|
||||||
|
"@clusterio/lib/plugin": { singleton: true },
|
||||||
|
"@clusterio/lib/schema": { singleton: true },
|
||||||
|
"@clusterio/lib/users": { singleton: true },
|
||||||
"@clusterio/web_ui": { singleton: true },
|
"@clusterio/web_ui": { singleton: true },
|
||||||
"ajv": {},
|
"ajv": {},
|
||||||
"antd": { singleton: true },
|
"antd": { singleton: true },
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ module.exports = (env = {}) => merge(common(env), {
|
|||||||
"./package.json": "./package.json",
|
"./package.json": "./package.json",
|
||||||
},
|
},
|
||||||
shared: {
|
shared: {
|
||||||
"@clusterio/lib": { import: false },
|
"@clusterio/lib/config": { import: false },
|
||||||
|
"@clusterio/lib/link": { import: false },
|
||||||
"@clusterio/web_ui": { import: false },
|
"@clusterio/web_ui": { import: false },
|
||||||
"ajv": { import: false },
|
"ajv": { import: false },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ module.exports = (env = {}) => merge(common(env), {
|
|||||||
"./package.json": "./package.json",
|
"./package.json": "./package.json",
|
||||||
},
|
},
|
||||||
shared: {
|
shared: {
|
||||||
"@clusterio/lib": { import: false },
|
"@clusterio/lib/config": { import: false },
|
||||||
|
"@clusterio/lib/link": { import: false },
|
||||||
"@clusterio/web_ui": { import: false },
|
"@clusterio/web_ui": { import: false },
|
||||||
"ajv": { import: false },
|
"ajv": { import: false },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ module.exports = (env = {}) => merge(common(env), {
|
|||||||
"./package.json": "./package.json",
|
"./package.json": "./package.json",
|
||||||
},
|
},
|
||||||
shared: {
|
shared: {
|
||||||
"@clusterio/lib": { import: false },
|
"@clusterio/lib/config": { import: false },
|
||||||
|
"@clusterio/lib/link": { import: false },
|
||||||
"@clusterio/web_ui": { import: false },
|
"@clusterio/web_ui": { import: false },
|
||||||
"ajv": { import: false },
|
"ajv": { import: false },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ module.exports = (env = {}) => merge(common(env), {
|
|||||||
"./package.json": "./package.json",
|
"./package.json": "./package.json",
|
||||||
},
|
},
|
||||||
shared: {
|
shared: {
|
||||||
"@clusterio/lib": { import: false },
|
"@clusterio/lib/config": { import: false },
|
||||||
|
"@clusterio/lib/link": { import: false },
|
||||||
"@clusterio/web_ui": { import: false },
|
"@clusterio/web_ui": { import: false },
|
||||||
"ajv": { import: false },
|
"ajv": { import: false },
|
||||||
"antd": { import: false },
|
"antd": { import: false },
|
||||||
|
|||||||
Reference in new issue
Block a user