@moneko/core 3.0.0-beta.104 → 3.0.0-beta.106
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/lib/common.js +2 -1
- package/lib/module.config.js +2 -1
- package/lib/webpack.common.d.ts +1 -2
- package/lib/webpack.common.js +2 -2
- package/lib/webpack.dev.d.ts +1 -1
- package/lib/webpack.dev.js +5 -2
- package/lib/webpack.prod.d.ts +1 -1
- package/lib/webpack.prod.js +5 -2
- package/package.json +2 -2
- package/typings/global.d.ts +2 -1
package/lib/common.js
CHANGED
package/lib/module.config.js
CHANGED
package/lib/webpack.common.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import './cleanup.js';
|
|
2
2
|
import type { WebpackConfiguration } from 'webpack-dev-server';
|
|
3
3
|
export declare const outputConfig: WebpackConfiguration['output'];
|
|
4
|
-
declare const
|
|
5
|
-
export default config;
|
|
4
|
+
export declare const clientConfig: WebpackConfiguration;
|
package/lib/webpack.common.js
CHANGED
|
@@ -104,13 +104,14 @@ if (CONFIG.output) {
|
|
|
104
104
|
const dirDeep = CONFIG.routeBaseName.split('/').filter(Boolean).length;
|
|
105
105
|
const page404 = `${Array(dirDeep).fill('..').join('/') + (dirDeep ? '/' : '')}404.html`;
|
|
106
106
|
const { pathSegmentsToKeep =dirDeep , path =page404 } = CONFIG.fixBrowserRouter || {};
|
|
107
|
-
const
|
|
107
|
+
export const clientConfig = {
|
|
108
108
|
entry: entryMap,
|
|
109
109
|
stats: 'errors-only',
|
|
110
110
|
infrastructureLogging: {
|
|
111
111
|
level: 'none'
|
|
112
112
|
},
|
|
113
113
|
target: 'web',
|
|
114
|
+
externalsPresets: CONFIG.externalsPresets,
|
|
114
115
|
plugins: [
|
|
115
116
|
new AutomaticPrefetchPlugin(),
|
|
116
117
|
...moduleFederation,
|
|
@@ -213,4 +214,3 @@ const config = {
|
|
|
213
214
|
externals: CONFIG.externals,
|
|
214
215
|
output: outputConfig
|
|
215
216
|
};
|
|
216
|
-
export default config;
|
package/lib/webpack.dev.d.ts
CHANGED
package/lib/webpack.dev.js
CHANGED
|
@@ -7,7 +7,7 @@ import { hasPkg } from './has-pkg.js';
|
|
|
7
7
|
import { getIPv4, getPort } from './net.js';
|
|
8
8
|
import { CUSTOMCONFIG, isReact } from './process-env.js';
|
|
9
9
|
import { isFunction, resolveProgramPath } from './utils.js';
|
|
10
|
-
import
|
|
10
|
+
import { clientConfig } from './webpack.common.js';
|
|
11
11
|
const { HotModuleReplacementPlugin } = webpack;
|
|
12
12
|
const { yellow , green } = chalk;
|
|
13
13
|
const ip = getIPv4();
|
|
@@ -31,7 +31,7 @@ CONFIG.devServer.port = port;
|
|
|
31
31
|
const initRouteBase = CONFIG.routeBaseName === '/';
|
|
32
32
|
const protocol = CONFIG.devServer.https ? 'https:' : 'http:';
|
|
33
33
|
const routeBase = initRouteBase ? '' : CONFIG.routeBaseName;
|
|
34
|
-
|
|
34
|
+
const client = merge(clientConfig, {
|
|
35
35
|
devtool: devtool,
|
|
36
36
|
mode: 'development',
|
|
37
37
|
cache: cacheConfig,
|
|
@@ -92,3 +92,6 @@ export default merge(common, {
|
|
|
92
92
|
})
|
|
93
93
|
].filter(Boolean)
|
|
94
94
|
});
|
|
95
|
+
export default [
|
|
96
|
+
client
|
|
97
|
+
];
|
package/lib/webpack.prod.d.ts
CHANGED
package/lib/webpack.prod.js
CHANGED
|
@@ -7,7 +7,7 @@ import { merge } from 'webpack-merge';
|
|
|
7
7
|
import { CONFIG } from './common.js';
|
|
8
8
|
import { getMinifyOption } from './minify.js';
|
|
9
9
|
import { CUSTOMCONFIG } from './process-env.js';
|
|
10
|
-
import
|
|
10
|
+
import { clientConfig } from './webpack.common.js';
|
|
11
11
|
const { optimize } = webpack;
|
|
12
12
|
const { cssnanoMinify , swcMinify } = CssMinimizerPlugin;
|
|
13
13
|
const defaultJsMiniify = CONFIG.compiler === 'swc' ? 'swc' : 'terser';
|
|
@@ -48,7 +48,7 @@ if (CONFIG.cacheDirectory) {
|
|
|
48
48
|
name: `${CUSTOMCONFIG || 'default'}-production`
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
const client = merge(clientConfig, {
|
|
52
52
|
devtool: CONFIG.devtool === false || CONFIG.devtool ? CONFIG.devtool : 'cheap-module-source-map',
|
|
53
53
|
mode: 'production',
|
|
54
54
|
cache: cacheConfig,
|
|
@@ -65,3 +65,6 @@ export default merge(common, {
|
|
|
65
65
|
})
|
|
66
66
|
].filter(Boolean)
|
|
67
67
|
});
|
|
68
|
+
export default [
|
|
69
|
+
client
|
|
70
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.106",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"webpack": "5.77.0",
|
|
42
42
|
"webpack-bundle-analyzer": "4.9.0",
|
|
43
43
|
"webpack-cli": "5.1.4",
|
|
44
|
-
"webpack-dev-server": "4.15.
|
|
44
|
+
"webpack-dev-server": "4.15.1",
|
|
45
45
|
"webpack-merge": "5.9.0",
|
|
46
46
|
"webpack-virtual-modules": "0.5.0",
|
|
47
47
|
"webpackbar": "5.0.2",
|
package/typings/global.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { JsMinifyOptions, Config as SwcConfig } from '@swc/core';
|
|
|
6
6
|
import type { CssNanoOptionsExtended } from 'css-minimizer-webpack-plugin';
|
|
7
7
|
import type { MinifyOptions } from 'terser';
|
|
8
8
|
import type { Options } from 'ts-import-plugin';
|
|
9
|
-
import type { Configuration, RuleSetRule, WebpackPluginInstance } from 'webpack';
|
|
9
|
+
import type { Configuration, ExternalsPresets, RuleSetRule, WebpackPluginInstance } from 'webpack';
|
|
10
10
|
import type {
|
|
11
11
|
ProxyArray,
|
|
12
12
|
ProxyConfigArray,
|
|
@@ -294,6 +294,7 @@ export declare type ConfigType<T extends 'tsc' | 'swc' = 'swc'> = {
|
|
|
294
294
|
* @default true
|
|
295
295
|
*/
|
|
296
296
|
normalizeCss?: boolean;
|
|
297
|
+
externalsPresets?: ExternalsPresets;
|
|
297
298
|
};
|
|
298
299
|
export declare interface ModuleFederationOption {
|
|
299
300
|
/** 模块名称,唯一性,不能重名 */
|