gant-core 2.0.7 → 2.0.9

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/lib/cli/create/module/index.mjs +1 -1
  3. package/lib/core/store/index.js +1 -1
  4. package/package.json +1 -1
  5. package/lib/cli/config/defineConfig.js +0 -104
  6. package/lib/cli/config/index.js +0 -156
  7. package/lib/cli/copyfiles/index.js +0 -34
  8. package/lib/cli/create/config/index.js +0 -1233
  9. package/lib/cli/create/index.js +0 -5
  10. package/lib/cli/create/module/index.js +0 -33215
  11. package/lib/cli/helper/index.d.ts +0 -17
  12. package/lib/cli/i18n/index.js +0 -22186
  13. package/lib/cli/i18n/utils.js +0 -181
  14. package/lib/cli/index.js +0 -3656
  15. package/lib/cli/ms/index.js +0 -23
  16. package/lib/cli/routes/index.js +0 -76
  17. package/lib/cli/template/core.txt +0 -1
  18. package/lib/cli/tsconfig/index.js +0 -71
  19. package/lib/cli/utils/detectPort.js +0 -121
  20. package/lib/cli/utils/getJavascriptfile.js +0 -15
  21. package/lib/cli/utils/index.d.ts +0 -18
  22. package/lib/cli/utils/index.js +0 -4949
  23. package/lib/cli/webpack/Webpack.js +0 -61
  24. package/lib/cli/webpack/config/analyzer.config.js +0 -18
  25. package/lib/cli/webpack/config/browsers.js +0 -14
  26. package/lib/cli/webpack/config/cssRules.js +0 -81
  27. package/lib/cli/webpack/config/default.config.js +0 -180
  28. package/lib/cli/webpack/config/development.config.js +0 -46
  29. package/lib/cli/webpack/config/framework/index.js +0 -26
  30. package/lib/cli/webpack/config/framework/react.js +0 -24
  31. package/lib/cli/webpack/config/framework/vue.js +0 -34
  32. package/lib/cli/webpack/config/index.js +0 -24
  33. package/lib/cli/webpack/config/production.config.js +0 -75
  34. package/lib/cli/webpack/plugins/copy.js +0 -21
  35. package/lib/cli/webpack/plugins/index.js +0 -5
  36. package/lib/core/event/index.js +0 -2
  37. package/lib/core/microservices/index.js +0 -11
  38. package/lib/core/utils/index.js +0 -84
  39. package/lib/helper/acorn-BmLbFX50.js +0 -19
  40. package/lib/helper/angular-DGof4p_D.js +0 -7
  41. package/lib/helper/babel-Nwboghbx.js +0 -22
  42. package/lib/helper/estree-CSMrPe9Y.js +0 -44
  43. package/lib/helper/flow-h7wrzCJb.js +0 -27
  44. package/lib/helper/glimmer-Bew2Vz0Y.js +0 -38
  45. package/lib/helper/graphql-BRv4I30B.js +0 -38
  46. package/lib/helper/html-uZad-YZz.js +0 -28
  47. package/lib/helper/index.js +0 -27848
  48. package/lib/helper/markdown-iwdpU9Ia.js +0 -68
  49. package/lib/helper/meriyah-UktrHj4H.js +0 -11
  50. package/lib/helper/postcss-H_0MYJut.js +0 -58
  51. package/lib/helper/typescript-CqdW0_wW.js +0 -31
  52. package/lib/helper/yaml-DXNEs-hZ.js +0 -170
@@ -1,61 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@rspack/core');
4
- var devServer = require('@rspack/dev-server');
5
- var webpack_config_index = require('./config/index.js');
6
- require('../utils/index.js');
7
- var utils_detectPort = require('../utils/detectPort.js');
8
-
9
- class Webpack {
10
- Compiler;
11
- Config;
12
- devServer = null;
13
- type;
14
- constructor(config, cwd, type) {
15
- this.type = type;
16
- try {
17
- let defaultConfig = {};
18
- if (type === 'development') {
19
- defaultConfig = webpack_config_index.getDevConfig(config, cwd);
20
- }
21
- else if (type === 'analyzer') {
22
- defaultConfig = webpack_config_index.getAnalyzerConfig(config, cwd);
23
- }
24
- else {
25
- defaultConfig = webpack_config_index.getProductionConfig(config, cwd);
26
- }
27
- this.Config = defaultConfig;
28
- this.Compiler = core.rspack(defaultConfig);
29
- }
30
- catch (error) {
31
- console.log(error);
32
- }
33
- }
34
- runBuild = () => {
35
- this.Compiler.run((err, stats) => {
36
- if (err) {
37
- console.log(err.message);
38
- return;
39
- }
40
- console.log(stats?.toString({
41
- colors: true,
42
- }));
43
- for (const assetName of Object.keys(stats?.compilation?.assets || {})) {
44
- console.log(`Generated asset: ${assetName}`);
45
- }
46
- });
47
- };
48
- runServer = async (config) => {
49
- const effectivePort = Number(config?.port ?? this.Config?.devServer?.port ?? 8080);
50
- const availablePort = await utils_detectPort.detectPort(effectivePort);
51
- this.devServer = new devServer.RspackDevServer({
52
- ...this.Config?.devServer,
53
- ...config,
54
- port: availablePort,
55
- }, this.Compiler);
56
- await this.devServer?.start();
57
- };
58
- }
59
-
60
- exports.Webpack = Webpack;
61
- //# sourceMappingURL=Webpack.js.map
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- var module$1 = require('module');
4
- var webpack_config_production_config = require('./production.config.js');
5
-
6
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
- const _require = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('webpack/config/analyzer.config.js', document.baseURI).href)));
8
- var _getAnalyzerConfig = (config, cwd) => {
9
- const { RsdoctorRspackPlugin } = _require('@rsdoctor/rspack-plugin');
10
- const proConfig = webpack_config_production_config.getProConfig(config, cwd);
11
- return {
12
- ...proConfig,
13
- plugins: [...(proConfig.plugins || []), new RsdoctorRspackPlugin({})],
14
- };
15
- };
16
-
17
- exports._getAnalyzerConfig = _getAnalyzerConfig;
18
- //# sourceMappingURL=analyzer.config.js.map
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- var browserslist = [
4
- 'Chrome >= 80',
5
- 'Firefox >= 72',
6
- 'Safari >= 13.1',
7
- 'Edge >= 80',
8
- 'iOS >= 13.4',
9
- 'not IE 11',
10
- '> 1%',
11
- ];
12
-
13
- exports.browserslist = browserslist;
14
- //# sourceMappingURL=browsers.js.map
@@ -1,81 +0,0 @@
1
- 'use strict';
2
-
3
- var module$1 = require('module');
4
- var core = require('@rspack/core');
5
- var webpack_config_browsers = require('./browsers.js');
6
-
7
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
8
- const _require = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('webpack/config/cssRules.js', document.baseURI).href)));
9
- const getCssRules = (mode) => {
10
- return [
11
- {
12
- test: /\.(less)$/,
13
- exclude: /node_modules|public/,
14
- use: [
15
- mode === 'development' ? _require.resolve('style-loader') : core.CssExtractRspackPlugin.loader,
16
- {
17
- loader: _require.resolve('css-loader'),
18
- options: {
19
- modules: {
20
- // 启用CSS模块化
21
- localIdentName: '[name]__[local]--[hash:base64:5]',
22
- },
23
- },
24
- },
25
- {
26
- loader: _require.resolve('postcss-loader'),
27
- options: {
28
- postcssOptions: {
29
- plugins: [
30
- _require.resolve('postcss-short'),
31
- _require('postcss-preset-env')({
32
- browsers: webpack_config_browsers.browserslist,
33
- autoprefixer: {
34
- flexbox: 'no-2009',
35
- },
36
- stage: 3,
37
- }),
38
- ],
39
- },
40
- },
41
- },
42
- {
43
- loader: _require.resolve('less-loader'),
44
- options: {
45
- implementation: _require.resolve('less'),
46
- lessOptions: {
47
- javascriptEnabled: true,
48
- },
49
- },
50
- },
51
- ],
52
- },
53
- {
54
- test: /\.(css)$/,
55
- use: [
56
- mode === 'development' ? _require.resolve('style-loader') : core.CssExtractRspackPlugin.loader,
57
- _require.resolve('css-loader'),
58
- {
59
- loader: _require.resolve('postcss-loader'),
60
- options: {
61
- postcssOptions: {
62
- plugins: [
63
- _require.resolve('postcss-short'),
64
- _require('postcss-preset-env')({
65
- browsers: webpack_config_browsers.browserslist,
66
- autoprefixer: {
67
- flexbox: 'no-2009',
68
- },
69
- stage: 3,
70
- }),
71
- ],
72
- },
73
- },
74
- },
75
- ],
76
- },
77
- ];
78
- };
79
-
80
- exports.getCssRules = getCssRules;
81
- //# sourceMappingURL=cssRules.js.map
@@ -1,180 +0,0 @@
1
- 'use strict';
2
-
3
- var utils_index = require('../../utils/index.js');
4
- var webpack_config_cssRules = require('./cssRules.js');
5
- var path = require('path');
6
- var core = require('@rspack/core');
7
- var webpack_config_browsers = require('./browsers.js');
8
- var webpack_config_framework_index = require('./framework/index.js');
9
-
10
- const OMIT_NAMES_ALL = [
11
- 'name',
12
- 'routes',
13
- 'mpas',
14
- 'packages',
15
- 'microServiceMap',
16
- 'base',
17
- 'customHistoryApiFallback',
18
- 'outputPathDir',
19
- 'define',
20
- 'setting',
21
- 'framework',
22
- 'library',
23
- 'compression',
24
- 'terserOptions',
25
- 'htmlTemplatePath',
26
- 'locales',
27
- 'mfa',
28
- 'publicPathDir',
29
- 'provide',
30
- 'copy',
31
- ];
32
- const getDefaultConfig = (cwd, config) => {
33
- const webpackConfig = utils_index.omit(config, OMIT_NAMES_ALL);
34
- let { base = '/', routes, htmlTemplatePath, outputPathDir = 'dist', define, provide, } = utils_index.pick(config, OMIT_NAMES_ALL);
35
- base = /^\/.*\/$/.test(base) ? base : '/';
36
- const fw = webpack_config_framework_index.getFrameworkConfig(config, config.mode);
37
- let entry = config.entry || {};
38
- const htmlPlugins = [];
39
- if (utils_index.isEmpty(entry))
40
- entry['index'] = path.resolve(cwd, 'src/main');
41
- if (typeof entry['index'] == 'string') {
42
- const tempPath = typeof htmlTemplatePath === 'string' ? htmlTemplatePath : htmlTemplatePath?.['index'];
43
- const htmlpath = utils_index.getMpasPageHtml(tempPath);
44
- htmlPlugins.push(new core.rspack.HtmlRspackPlugin({
45
- template: htmlpath,
46
- filename: `index.html`,
47
- chunks: ['index'],
48
- publicPath: base,
49
- base,
50
- templateParameters: {
51
- base,
52
- },
53
- }));
54
- config.entry = entry;
55
- }
56
- if (!utils_index.isEmpty(entry)) {
57
- // 存在多entry,注册多个HtmlWebpackPlugin
58
- Object.entries(entry).forEach(([key, value]) => {
59
- if (key !== 'index') {
60
- const tempPath = typeof htmlTemplatePath === 'string' ? htmlTemplatePath : htmlTemplatePath?.[key];
61
- const htmlpath = utils_index.getMpasPageHtml(tempPath);
62
- htmlPlugins.push(new core.rspack.HtmlRspackPlugin({
63
- template: htmlpath,
64
- filename: `${key}.html`,
65
- chunks: [key],
66
- publicPath: base,
67
- base,
68
- templateParameters: {
69
- base,
70
- },
71
- }));
72
- }
73
- });
74
- }
75
- const cssRules = webpack_config_cssRules.getCssRules(config.mode);
76
- return utils_index.mergeConfig({
77
- entry,
78
- stats: 'minimal',
79
- devServer: {
80
- static: {
81
- directory: path.resolve(cwd, 'src/.gant/public'),
82
- publicPath: base,
83
- },
84
- compress: true,
85
- historyApiFallback: utils_index.has(config, 'customHistoryApiFallback')
86
- ? config?.customHistoryApiFallback
87
- : {
88
- index: path.resolve(base, 'index.html'),
89
- rewrites: [
90
- {
91
- from: /^\/public\/(.*)$/,
92
- to: cxt => {
93
- return path.resolve(base, cxt.match[1]);
94
- },
95
- },
96
- ],
97
- },
98
- },
99
- module: {
100
- rules: [
101
- ...fw.loaders,
102
- {
103
- test: /\.(ts|tsx)$/,
104
- exclude: /node_modules/,
105
- use: {
106
- loader: require.resolve('swc-loader'),
107
- options: {
108
- jsc: {
109
- target: 'es2020',
110
- parser: {
111
- syntax: 'typescript',
112
- tsx: true,
113
- dynamicImport: true,
114
- },
115
- transform: fw.swcTransform,
116
- },
117
- },
118
- },
119
- },
120
- ...cssRules,
121
- {
122
- test: /\.ejs$/,
123
- use: {
124
- loader: require.resolve('ejs-loader'),
125
- options: {
126
- esModule: false,
127
- },
128
- },
129
- },
130
- {
131
- test: /\.(png|jpg|gif|woff|woff2|eot|ttf|svg)$/i,
132
- use: [
133
- {
134
- loader: require.resolve('url-loader'),
135
- options: {
136
- limit: 8192, // 文件大小阈值,小于该值的文件会转换为 Data URL
137
- name: '[name][hash].[ext]', // 输出文件名格式
138
- outputPath: 'assets/', // 输出文件夹名称
139
- },
140
- },
141
- ],
142
- },
143
- ],
144
- },
145
- resolve: {
146
- extensions: ['.tsx', '.ts', '.js', '.jsx', '.json', ...fw.extensions],
147
- alias: {
148
- '@gant/setting': path.resolve(cwd, utils_index.getSrcPath(), '.gant/setting.ts'),
149
- '@gant/microServiceMap': path.resolve(cwd, utils_index.getSrcPath(), '.gant/microServiceMap.ts'),
150
- },
151
- },
152
- output: {
153
- path: path.resolve(cwd, outputPathDir),
154
- publicPath: base,
155
- charset: true, //输出文件的编码`utf-8`
156
- clean: true, //在生成新的打包输出之前清空path对应的dist目
157
- },
158
- plugins: [
159
- ...fw.plugins,
160
- ...htmlPlugins,
161
- new core.rspack.ProvidePlugin({
162
- ...provide,
163
- }),
164
- new core.rspack.ProgressPlugin(), // 使用ProgressPlugin插件显示进度条
165
- new core.rspack.DefinePlugin({
166
- GANT_START_TIME: JSON.stringify(global.__gant_start_time),
167
- BASE: JSON.stringify(base),
168
- 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
169
- ...utils_index.mapValues(define, value => JSON.stringify(value)),
170
- }),
171
- new core.rspack.BannerPlugin({
172
- banner: `/*! @browserslist ${webpack_config_browsers.browserslist.join(', ')} */`,
173
- raw: true,
174
- }),
175
- ],
176
- }, webpackConfig);
177
- };
178
-
179
- exports.getDefaultConfig = getDefaultConfig;
180
- //# sourceMappingURL=default.config.js.map
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- var utils_index = require('../../utils/index.js');
4
- var path = require('path');
5
- var webpack_config_framework_index = require('./framework/index.js');
6
-
7
- var _getDevlopmentConfig = (config, cwd) => {
8
- const { base = '/' } = config;
9
- const fw = webpack_config_framework_index.getFrameworkConfig(config, 'development');
10
- return utils_index.mergeConfig({
11
- mode: 'development',
12
- devtool: 'eval-source-map',
13
- devServer: {
14
- port: 8080,
15
- hot: true,
16
- open: true,
17
- client: { overlay: false },
18
- static: {
19
- directory: path.resolve(cwd, 'src/.gant/public'),
20
- publicPath: base,
21
- },
22
- compress: true,
23
- historyApiFallback: utils_index.has(config, 'customHistoryApiFallback')
24
- ? config?.customHistoryApiFallback
25
- : {
26
- index: path.resolve(base, 'index.html'),
27
- rewrites: [
28
- {
29
- from: new RegExp(`${base}public/(.*)`),
30
- to: cxt => {
31
- if (cxt.match && cxt.match[1]) {
32
- return path.resolve(base, cxt.match[1]);
33
- }
34
- return base;
35
- },
36
- },
37
- ],
38
- },
39
- },
40
- resolve: {},
41
- plugins: [...fw.devPlugins],
42
- }, config);
43
- };
44
-
45
- exports._getDevlopmentConfig = _getDevlopmentConfig;
46
- //# sourceMappingURL=development.config.js.map
@@ -1,26 +0,0 @@
1
- 'use strict';
2
-
3
- var webpack_config_framework_react = require('./react.js');
4
- var webpack_config_framework_vue = require('./vue.js');
5
-
6
- /**
7
- * Resolve the target framework from user config.
8
- * Priority: framework > default 'react'
9
- */
10
- function resolveFramework(config) {
11
- return config.framework || 'react';
12
- }
13
- /**
14
- * Get the full framework config for a given framework and mode.
15
- */
16
- function getFrameworkConfig(config, mode) {
17
- const fw = resolveFramework(config);
18
- if (fw === 'vue') {
19
- return webpack_config_framework_vue.getVueConfig();
20
- }
21
- return webpack_config_framework_react.getReactConfig(mode);
22
- }
23
-
24
- exports.getFrameworkConfig = getFrameworkConfig;
25
- exports.resolveFramework = resolveFramework;
26
- //# sourceMappingURL=index.js.map
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- var pluginReactRefresh = require('@rspack/plugin-react-refresh');
4
-
5
- function getReactConfig(mode) {
6
- const isDev = mode === 'development';
7
- return {
8
- swcTransform: {
9
- react: {
10
- runtime: 'automatic',
11
- development: isDev,
12
- refresh: isDev,
13
- },
14
- },
15
- loaders: [],
16
- plugins: [],
17
- extensions: [],
18
- tsConfigSuffix: 'react',
19
- devPlugins: isDev ? [new pluginReactRefresh.ReactRefreshRspackPlugin({ overlay: false })] : [],
20
- };
21
- }
22
-
23
- exports.getReactConfig = getReactConfig;
24
- //# sourceMappingURL=react.js.map
@@ -1,34 +0,0 @@
1
- 'use strict';
2
-
3
- var module$1 = require('module');
4
-
5
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
6
- const _require = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('webpack/config/framework/vue.js', document.baseURI).href)));
7
- /**
8
- * Vue framework configuration.
9
- *
10
- * Compatibility note:
11
- * Rspack v2 does NOT have built-in Vue SFC support, but vue-loader@17 works
12
- * through Rspack's webpack 5 plugin API compatibility layer.
13
- * VueLoaderPlugin is compatible with Rspack's Compiler interface.
14
- * Hot Module Replacement (HMR) works via vue-loader's built-in HMR support.
15
- */
16
- function getVueConfig() {
17
- const VueLoaderPlugin = _require('vue-loader').VueLoaderPlugin;
18
- return {
19
- swcTransform: {},
20
- loaders: [
21
- {
22
- test: /\.vue$/,
23
- loader: _require.resolve('vue-loader'),
24
- },
25
- ],
26
- plugins: [new VueLoaderPlugin()],
27
- extensions: ['.vue'],
28
- tsConfigSuffix: 'vue',
29
- devPlugins: [],
30
- };
31
- }
32
-
33
- exports.getVueConfig = getVueConfig;
34
- //# sourceMappingURL=vue.js.map
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- var webpack_config_production_config = require('./production.config.js');
4
- var webpack_config_default_config = require('./default.config.js');
5
- var webpack_config_development_config = require('./development.config.js');
6
- var webpack_config_analyzer_config = require('./analyzer.config.js');
7
-
8
- const getProductionConfig = (config, cwd) => {
9
- const proConfig = webpack_config_production_config.getProConfig(config, cwd);
10
- return webpack_config_default_config.getDefaultConfig(cwd, proConfig);
11
- };
12
- const getDevConfig = (config, cwd) => {
13
- const proConfig = webpack_config_development_config._getDevlopmentConfig(config, cwd);
14
- return webpack_config_default_config.getDefaultConfig(cwd, proConfig);
15
- };
16
- const getAnalyzerConfig = (config, cwd) => {
17
- const previewConfig = webpack_config_analyzer_config._getAnalyzerConfig(config, cwd);
18
- return webpack_config_default_config.getDefaultConfig(cwd, previewConfig);
19
- };
20
-
21
- exports.getAnalyzerConfig = getAnalyzerConfig;
22
- exports.getDevConfig = getDevConfig;
23
- exports.getProductionConfig = getProductionConfig;
24
- //# sourceMappingURL=index.js.map
@@ -1,75 +0,0 @@
1
- 'use strict';
2
-
3
- var webpack_plugins_copy = require('../plugins/copy.js');
4
- var path = require('path');
5
- var utils_index = require('../../utils/index.js');
6
- var core = require('@rspack/core');
7
- var CompressionPlugin = require('compression-webpack-plugin');
8
-
9
- var getProConfig = (config, cwd) => {
10
- const { outputPathDir = 'dist', publicPathDir = path.resolve(cwd, utils_index.getSrcPath(), '.gant/public'), optimization, library, compression = true, copy: userCopyPatterns = [], } = config;
11
- const plugins = [];
12
- if (library)
13
- return utils_index.mergeConfig({
14
- mode: 'production',
15
- optimization: {
16
- minimize: true,
17
- ...optimization,
18
- },
19
- plugins: [new core.CssExtractRspackPlugin()],
20
- }, config);
21
- if (compression === true) {
22
- plugins.push(new CompressionPlugin({
23
- algorithm: 'gzip', // 使用gzip压缩
24
- test: /\.js(\?.*)?$/i, // 匹配需要压缩的文件
25
- threshold: 10240, // 对大于10kB的文件进行压缩
26
- minRatio: 0.7, // 压缩比例
27
- deleteOriginalAssets: false, // 是否删除原文件
28
- }));
29
- }
30
- return utils_index.mergeConfig({
31
- mode: 'production',
32
- devtool: 'source-map',
33
- optimization: {
34
- minimize: true,
35
- runtimeChunk: 'single',
36
- moduleIds: 'deterministic',
37
- ...optimization,
38
- splitChunks: {
39
- chunks: 'all',
40
- minSize: 10240,
41
- maxAsyncRequests: 30,
42
- maxInitialRequests: 30,
43
- minChunks: 1,
44
- maxSize: 1024 * 1024 * 5,
45
- ...optimization?.splitChunks,
46
- cacheGroups: {
47
- vendors: {
48
- chunks: 'initial',
49
- name: 'vendors',
50
- test: /[\\/]node_modules[\\/]/,
51
- priority: -10,
52
- reuseExistingChunk: true,
53
- },
54
- ...utils_index.get(optimization?.splitChunks, 'cacheGroups', {}),
55
- },
56
- },
57
- },
58
- plugins: [
59
- new core.CssExtractRspackPlugin(),
60
- new webpack_plugins_copy.CopyFolderPlugin({
61
- patterns: [
62
- {
63
- from: publicPathDir,
64
- to: path.resolve(cwd, outputPathDir, 'public'),
65
- },
66
- ...userCopyPatterns,
67
- ],
68
- }),
69
- ...plugins,
70
- ],
71
- }, config);
72
- };
73
-
74
- exports.getProConfig = getProConfig;
75
- //# sourceMappingURL=production.config.js.map
@@ -1,21 +0,0 @@
1
- 'use strict';
2
-
3
- var utils_index = require('../../utils/index.js');
4
-
5
- class CopyFolderPlugin {
6
- options;
7
- constructor(options) {
8
- this.options = options;
9
- }
10
- apply(compiler) {
11
- compiler.hooks.afterEmit.tap('CopyFolderPlugin', () => {
12
- this.options?.patterns?.map((item) => {
13
- utils_index.copyFolder(item.from, item.to);
14
- return;
15
- });
16
- });
17
- }
18
- }
19
-
20
- exports.CopyFolderPlugin = CopyFolderPlugin;
21
- //# sourceMappingURL=copy.js.map
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- require('../../utils/index.js');
4
-
5
- //# sourceMappingURL=index.js.map
@@ -1,2 +0,0 @@
1
- import m from"mitt";
2
- //# sourceMappingURL=index.js.map
@@ -1,11 +0,0 @@
1
- import { get } from 'lodash-es';
2
-
3
- /**
4
- * 异常处理程序
5
- */
6
- const TraceIdKey = 'x-g-trace-id';
7
- const getTraceId = (response) => get(response, 'headers', TraceIdKey) ||
8
- get(response, 'config.headers', TraceIdKey);
9
-
10
- export { getTraceId as g };
11
- //# sourceMappingURL=index.js.map