@modern-js/plugin-garfish 1.4.13-alpha.1 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @modern-js/plugin-garfish
2
2
 
3
+ ## 1.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 6451a098: fix: cyclic dependencies of @modern-js/core and @moden-js/webpack
8
+ - 45d5643a: feat(webpack): support modify html-webpack-plugin
9
+ - Updated dependencies [be7262e2]
10
+ - Updated dependencies [6451a098]
11
+ - Updated dependencies [d5a2cfd8]
12
+ - Updated dependencies [437367c6]
13
+ - @modern-js/runtime-core@1.4.7
14
+ - @modern-js/utils@1.7.6
15
+ - @modern-js/plugin-router@1.2.14
16
+
17
+ ## 1.5.0
18
+
19
+ ### Minor Changes
20
+
21
+ - f66fa0e98: feat: support tools.webpackChain config
22
+
23
+ ### Patch Changes
24
+
25
+ - 1dfe08fcd: feat(webpack): add CHAIN_ID constants for webpack chain
26
+ - Updated dependencies [33de0f7ec]
27
+ - @modern-js/utils@1.7.5
28
+ - @modern-js/plugin-router@1.2.14
29
+
30
+ ## 1.4.13
31
+
32
+ ### Patch Changes
33
+
34
+ - a37960018: fix: default config \_SERVER_DATA to insulationVariable and set disableCssExtract to be true
35
+ - Updated dependencies [b8cfc42cd]
36
+ - Updated dependencies [804a5bb8a]
37
+ - @modern-js/utils@1.7.4
38
+ - @modern-js/plugin-router@1.2.14
39
+
3
40
  ## 1.4.11
4
41
 
5
42
  ### Patch Changes
@@ -112,10 +112,10 @@ export default (({
112
112
  'Access-Control-Allow-Origin': '*'
113
113
  }
114
114
  },
115
- webpack: (webpackConfig, {
116
- chain,
115
+ webpackChain: (chain, {
117
116
  webpack,
118
- env: _env = process.env.NODE_ENV || 'development'
117
+ env: _env = process.env.NODE_ENV || 'development',
118
+ CHAIN_ID
119
119
  }) => {
120
120
  var _resolveOptions$deplo, _resolveWebpackConfig;
121
121
 
@@ -127,13 +127,13 @@ export default (({
127
127
 
128
128
  chain.output.libraryTarget('umd');
129
129
 
130
- if (resolveOptions !== null && resolveOptions !== void 0 && (_resolveOptions$serve = resolveOptions.server) !== null && _resolveOptions$serve !== void 0 && _resolveOptions$serve.port) {
131
- chain.output.publicPath(_env === 'development' ? `//localhost:${resolveOptions.server.port}/` : webpackConfig.output.publicPath);
130
+ if (resolveOptions !== null && resolveOptions !== void 0 && (_resolveOptions$serve = resolveOptions.server) !== null && _resolveOptions$serve !== void 0 && _resolveOptions$serve.port && _env === 'development') {
131
+ chain.output.publicPath(`//localhost:${resolveOptions.server.port}/`);
132
132
  } // add comments avoid sourcemap abnormal
133
133
 
134
134
 
135
135
  if (webpack.BannerPlugin) {
136
- chain.plugin('banner').use(webpack.BannerPlugin, [{
136
+ chain.plugin(CHAIN_ID.PLUGIN.BANNER).use(webpack.BannerPlugin, [{
137
137
  banner: 'Micro front-end'
138
138
  }]);
139
139
  }
@@ -150,8 +150,7 @@ export default (({
150
150
 
151
151
  if (!enableHtmlEntry) {
152
152
  chain.output.filename('index.js');
153
- chain.plugins.delete('html-main'); // chain.plugins.delete('mini-css-extract');
154
-
153
+ chain.plugins.delete(`${CHAIN_ID.PLUGIN.HTML}-main`);
155
154
  chain.optimization.runtimeChunk(false);
156
155
  chain.optimization.splitChunks({
157
156
  chunks: 'async'
@@ -129,10 +129,10 @@ var _default = ({
129
129
  'Access-Control-Allow-Origin': '*'
130
130
  }
131
131
  },
132
- webpack: (webpackConfig, {
133
- chain,
132
+ webpackChain: (chain, {
134
133
  webpack,
135
- env: _env = process.env.NODE_ENV || 'development'
134
+ env: _env = process.env.NODE_ENV || 'development',
135
+ CHAIN_ID
136
136
  }) => {
137
137
  var _resolveOptions$deplo, _resolveWebpackConfig;
138
138
 
@@ -144,13 +144,13 @@ var _default = ({
144
144
 
145
145
  chain.output.libraryTarget('umd');
146
146
 
147
- if (resolveOptions !== null && resolveOptions !== void 0 && (_resolveOptions$serve = resolveOptions.server) !== null && _resolveOptions$serve !== void 0 && _resolveOptions$serve.port) {
148
- chain.output.publicPath(_env === 'development' ? `//localhost:${resolveOptions.server.port}/` : webpackConfig.output.publicPath);
147
+ if (resolveOptions !== null && resolveOptions !== void 0 && (_resolveOptions$serve = resolveOptions.server) !== null && _resolveOptions$serve !== void 0 && _resolveOptions$serve.port && _env === 'development') {
148
+ chain.output.publicPath(`//localhost:${resolveOptions.server.port}/`);
149
149
  } // add comments avoid sourcemap abnormal
150
150
 
151
151
 
152
152
  if (webpack.BannerPlugin) {
153
- chain.plugin('banner').use(webpack.BannerPlugin, [{
153
+ chain.plugin(CHAIN_ID.PLUGIN.BANNER).use(webpack.BannerPlugin, [{
154
154
  banner: 'Micro front-end'
155
155
  }]);
156
156
  }
@@ -167,8 +167,7 @@ var _default = ({
167
167
 
168
168
  if (!enableHtmlEntry) {
169
169
  chain.output.filename('index.js');
170
- chain.plugins.delete('html-main'); // chain.plugins.delete('mini-css-extract');
171
-
170
+ chain.plugins.delete(`${CHAIN_ID.PLUGIN.HTML}-main`);
172
171
  chain.optimization.runtimeChunk(false);
173
172
  chain.optimization.splitChunks({
174
173
  chunks: 'async'
@@ -124,13 +124,13 @@ export default (function () {
124
124
  'Access-Control-Allow-Origin': '*'
125
125
  }
126
126
  },
127
- webpack: function webpack(webpackConfig, _ref3) {
127
+ webpackChain: function webpackChain(chain, _ref3) {
128
128
  var _resolveOptions$deplo, _resolveWebpackConfig;
129
129
 
130
- var chain = _ref3.chain,
131
- _webpack = _ref3.webpack,
130
+ var webpack = _ref3.webpack,
132
131
  _ref3$env = _ref3.env,
133
- env = _ref3$env === void 0 ? process.env.NODE_ENV || 'development' : _ref3$env;
132
+ env = _ref3$env === void 0 ? process.env.NODE_ENV || 'development' : _ref3$env,
133
+ CHAIN_ID = _ref3.CHAIN_ID;
134
134
  // eslint-disable-next-line react-hooks/rules-of-hooks
135
135
  var resolveOptions = useResolvedConfigContext();
136
136
 
@@ -139,13 +139,13 @@ export default (function () {
139
139
 
140
140
  chain.output.libraryTarget('umd');
141
141
 
142
- if (resolveOptions !== null && resolveOptions !== void 0 && (_resolveOptions$serve = resolveOptions.server) !== null && _resolveOptions$serve !== void 0 && _resolveOptions$serve.port) {
143
- chain.output.publicPath(env === 'development' ? "//localhost:".concat(resolveOptions.server.port, "/") : webpackConfig.output.publicPath);
142
+ if (resolveOptions !== null && resolveOptions !== void 0 && (_resolveOptions$serve = resolveOptions.server) !== null && _resolveOptions$serve !== void 0 && _resolveOptions$serve.port && env === 'development') {
143
+ chain.output.publicPath("//localhost:".concat(resolveOptions.server.port, "/"));
144
144
  } // add comments avoid sourcemap abnormal
145
145
 
146
146
 
147
- if (_webpack.BannerPlugin) {
148
- chain.plugin('banner').use(_webpack.BannerPlugin, [{
147
+ if (webpack.BannerPlugin) {
148
+ chain.plugin(CHAIN_ID.PLUGIN.BANNER).use(webpack.BannerPlugin, [{
149
149
  banner: 'Micro front-end'
150
150
  }]);
151
151
  }
@@ -162,8 +162,7 @@ export default (function () {
162
162
 
163
163
  if (!_enableHtmlEntry) {
164
164
  chain.output.filename('index.js');
165
- chain.plugins["delete"]('html-main'); // chain.plugins.delete('mini-css-extract');
166
-
165
+ chain.plugins["delete"]("".concat(CHAIN_ID.PLUGIN.HTML, "-main"));
167
166
  chain.optimization.runtimeChunk(false);
168
167
  chain.optimization.splitChunks({
169
168
  chunks: 'async'
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  export declare type Options = typeof garfish.options;
4
4
  export declare type ModuleInfo = GarfishInterfaces.AppInfo & {
5
5
  Component?: React.ComponentType | React.ElementType;
6
+ path?: string;
6
7
  originInfo?: Record<string, unknown>;
7
8
  };
8
9
  export declare type ModulesInfo = Array<ModuleInfo>;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.4.13-alpha.1",
14
+ "version": "1.5.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/runtime/index.d.ts",
17
17
  "typesVersions": {
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@babel/runtime": "^7",
53
- "@modern-js/utils": "^1.7.3",
53
+ "@modern-js/utils": "^1.7.6",
54
54
  "@types/debug": "^4.1.7",
55
55
  "@types/react-loadable": "^5.5.6",
56
56
  "debug": "^4.3.2",
@@ -59,10 +59,10 @@
59
59
  "react-loadable": "^5.5.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@modern-js/core": "1.10.2",
62
+ "@modern-js/core": "1.11.1",
63
63
  "@modern-js/plugin-router": "1.2.14",
64
- "@modern-js/runtime-core": "1.4.6",
65
- "@modern-js/types": "1.5.3",
64
+ "@modern-js/runtime-core": "1.4.7",
65
+ "@modern-js/types": "1.5.4",
66
66
  "@scripts/build": "0.0.0",
67
67
  "@scripts/jest-config": "0.0.0",
68
68
  "@testing-library/jest-dom": "^5.16.1",
@@ -84,15 +84,14 @@
84
84
  },
85
85
  "peerDependencies": {
86
86
  "@modern-js/plugin-router": "^1.2.14",
87
- "@modern-js/runtime-core": "^1.4.6",
87
+ "@modern-js/runtime-core": "^1.4.7",
88
88
  "react": "^17"
89
89
  },
90
90
  "sideEffects": false,
91
91
  "modernConfig": {},
92
92
  "publishConfig": {
93
93
  "registry": "https://registry.npmjs.org/",
94
- "access": "public",
95
- "types": "./dist/types/runtime/index.d.ts"
94
+ "access": "public"
96
95
  },
97
96
  "wireit": {
98
97
  "build": {
@@ -111,7 +110,8 @@
111
110
  "files": [
112
111
  "src/**/*",
113
112
  "tsconfig.json",
114
- "package.json"
113
+ "package.json",
114
+ "tests/**/*"
115
115
  ],
116
116
  "output": []
117
117
  }