@modern-js/app-tools 2.0.0-canary.0 → 2.0.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 +746 -0
- package/bin/modern.js +3 -0
- package/dist/js/modern/analyze/Builder.js +39 -0
- package/dist/js/modern/analyze/constants.js +16 -0
- package/dist/js/modern/analyze/generateCode.js +14 -15
- package/dist/js/modern/analyze/getBundleEntry.js +5 -1
- package/dist/js/modern/analyze/getClientRoutes/getRoutes.js +9 -6
- package/dist/js/modern/analyze/getFileSystemEntry.js +11 -3
- package/dist/js/modern/analyze/index.js +79 -8
- package/dist/js/modern/analyze/nestedRoutes.js +29 -22
- package/dist/js/modern/analyze/templates.js +28 -7
- package/dist/js/modern/analyze/utils.js +21 -4
- package/dist/js/modern/builder/builderPlugins/compatModern.js +12 -5
- package/dist/js/modern/builder/index.js +14 -16
- package/dist/js/modern/builder/share.js +4 -4
- package/dist/js/modern/builder/webpackPlugins/routerPlugin.js +3 -1
- package/dist/js/modern/commands/dev.js +6 -9
- package/dist/js/modern/commands/index.js +1 -1
- package/dist/js/modern/commands/{start.js → serve.js} +3 -1
- package/dist/js/modern/config/default.js +38 -61
- package/dist/js/modern/config/initial/createOutputConfig.js +1 -3
- package/dist/js/modern/config/initial/createSourceConfig.js +5 -1
- package/dist/js/modern/config/initial/inits.js +7 -0
- package/dist/js/modern/config/initial/transformNormalizedConfig.js +5 -1
- package/dist/js/modern/hooks.js +6 -1
- package/dist/js/modern/index.js +96 -59
- package/dist/js/modern/initialize/index.js +5 -4
- package/dist/js/modern/locale/en.js +1 -1
- package/dist/js/modern/locale/zh.js +1 -1
- package/dist/js/modern/schema/index.js +6 -8
- package/dist/js/modern/schema/legacy.js +2 -3
- package/dist/js/modern/utils/commands.js +6 -1
- package/dist/js/modern/utils/env.js +15 -0
- package/dist/js/modern/utils/getServerInternalPlugins.js +58 -0
- package/dist/js/node/analyze/Builder.js +64 -0
- package/dist/js/node/analyze/constants.js +44 -3
- package/dist/js/node/analyze/generateCode.js +33 -29
- package/dist/js/node/analyze/getBundleEntry.js +12 -4
- package/dist/js/node/analyze/getClientRoutes/getRoutes.js +33 -28
- package/dist/js/node/analyze/getClientRoutes/getRoutesLegacy.js +24 -22
- package/dist/js/node/analyze/getClientRoutes/index.js +8 -3
- package/dist/js/node/analyze/getClientRoutes/utils.js +10 -3
- package/dist/js/node/analyze/getFileSystemEntry.js +18 -6
- package/dist/js/node/analyze/getHtmlTemplate.js +18 -14
- package/dist/js/node/analyze/getServerRoutes.js +36 -34
- package/dist/js/node/analyze/index.js +105 -59
- package/dist/js/node/analyze/isDefaultExportFunction.js +7 -3
- package/dist/js/node/analyze/makeLegalIdentifier.js +7 -3
- package/dist/js/node/analyze/nestedRoutes.js +58 -49
- package/dist/js/node/analyze/templates.js +64 -37
- package/dist/js/node/analyze/utils.js +40 -18
- package/dist/js/node/builder/builderPlugins/compatModern.js +36 -27
- package/dist/js/node/builder/index.js +42 -55
- package/dist/js/node/builder/loaders/routerLoader.js +5 -3
- package/dist/js/node/builder/loaders/serverModuleLoader.js +5 -3
- package/dist/js/node/builder/share.js +11 -7
- package/dist/js/node/builder/webpackPlugins/htmlAsyncChunkPlugin.js +7 -3
- package/dist/js/node/builder/webpackPlugins/htmlBottomTemplate.js +7 -3
- package/dist/js/node/builder/webpackPlugins/routerPlugin.js +12 -8
- package/dist/js/node/commands/build.js +30 -28
- package/dist/js/node/commands/deploy.js +9 -5
- package/dist/js/node/commands/dev.js +39 -40
- package/dist/js/node/commands/index.js +5 -5
- package/dist/js/node/commands/inspect.js +10 -6
- package/dist/js/node/commands/{start.js → serve.js} +16 -10
- package/dist/js/node/config/default.js +44 -64
- package/dist/js/node/config/index.js +10 -3
- package/dist/js/node/config/initial/createHtmlConfig.js +7 -3
- package/dist/js/node/config/initial/createOutputConfig.js +8 -6
- package/dist/js/node/config/initial/createSourceConfig.js +12 -4
- package/dist/js/node/config/initial/createToolsConfig.js +7 -3
- package/dist/js/node/config/initial/index.js +9 -3
- package/dist/js/node/config/initial/inits.js +33 -22
- package/dist/js/node/config/initial/transformNormalizedConfig.js +12 -4
- package/dist/js/node/defineConfig.js +25 -22
- package/dist/js/node/exports/server.js +7 -3
- package/dist/js/node/hooks.js +13 -4
- package/dist/js/node/index.js +135 -111
- package/dist/js/node/initialize/index.js +33 -32
- package/dist/js/node/locale/en.js +8 -4
- package/dist/js/node/locale/index.js +8 -3
- package/dist/js/node/locale/zh.js +8 -4
- package/dist/js/node/schema/Schema.js +7 -3
- package/dist/js/node/schema/index.js +14 -11
- package/dist/js/node/schema/legacy.js +7 -6
- package/dist/js/node/types/config/deploy.js +15 -0
- package/dist/js/node/types/config/dev.js +15 -0
- package/dist/js/node/types/config/experiments.js +15 -0
- package/dist/js/node/types/config/html.js +15 -0
- package/dist/js/node/types/config/index.js +3 -3
- package/dist/js/node/types/config/output.js +15 -0
- package/dist/js/node/types/config/performance.js +15 -0
- package/dist/js/node/types/config/security.js +15 -0
- package/dist/js/node/types/config/source.js +15 -0
- package/dist/js/node/types/config/tools.js +15 -0
- package/dist/js/node/types/hooks.js +15 -0
- package/dist/js/node/types/index.js +5 -5
- package/dist/js/node/types/legacyConfig/deploy.js +15 -0
- package/dist/js/node/types/legacyConfig/dev.js +15 -0
- package/dist/js/node/types/legacyConfig/index.js +15 -0
- package/dist/js/node/types/legacyConfig/output.js +15 -0
- package/dist/js/node/types/legacyConfig/source.js +15 -0
- package/dist/js/node/types/legacyConfig/tools.js +15 -0
- package/dist/js/node/utils/commands.js +14 -4
- package/dist/js/node/utils/config.js +35 -30
- package/dist/js/node/utils/createFileWatcher.js +15 -10
- package/dist/js/node/utils/createServer.js +35 -29
- package/dist/js/node/utils/env.js +38 -0
- package/dist/js/node/utils/getServerInternalPlugins.js +79 -0
- package/dist/js/node/utils/getSpecifiedEntries.js +10 -6
- package/dist/js/node/utils/language.js +7 -3
- package/dist/js/node/utils/printInstructions.js +10 -6
- package/dist/js/node/utils/restart.js +11 -7
- package/dist/js/node/utils/routes.js +11 -7
- package/dist/js/node/utils/types.js +15 -0
- package/dist/js/treeshaking/analyze/Builder.js +199 -0
- package/dist/js/treeshaking/analyze/constants.js +13 -1
- package/dist/js/treeshaking/analyze/generateCode.js +14 -17
- package/dist/js/treeshaking/analyze/getBundleEntry.js +5 -1
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutes.js +9 -6
- package/dist/js/treeshaking/analyze/getFileSystemEntry.js +11 -3
- package/dist/js/treeshaking/analyze/index.js +110 -7
- package/dist/js/treeshaking/analyze/nestedRoutes.js +30 -23
- package/dist/js/treeshaking/analyze/templates.js +13 -8
- package/dist/js/treeshaking/analyze/utils.js +15 -4
- package/dist/js/treeshaking/builder/builderPlugins/compatModern.js +6 -1
- package/dist/js/treeshaking/builder/index.js +13 -20
- package/dist/js/treeshaking/builder/share.js +1 -4
- package/dist/js/treeshaking/builder/webpackPlugins/routerPlugin.js +3 -1
- package/dist/js/treeshaking/commands/dev.js +19 -24
- package/dist/js/treeshaking/commands/index.js +1 -1
- package/dist/js/treeshaking/commands/{start.js → serve.js} +10 -3
- package/dist/js/treeshaking/config/default.js +53 -56
- package/dist/js/treeshaking/config/initial/createOutputConfig.js +1 -3
- package/dist/js/treeshaking/config/initial/createSourceConfig.js +5 -1
- package/dist/js/treeshaking/config/initial/inits.js +7 -0
- package/dist/js/treeshaking/config/initial/transformNormalizedConfig.js +5 -1
- package/dist/js/treeshaking/hooks.js +6 -1
- package/dist/js/treeshaking/index.js +349 -132
- package/dist/js/treeshaking/initialize/index.js +6 -5
- package/dist/js/treeshaking/locale/en.js +1 -1
- package/dist/js/treeshaking/locale/zh.js +1 -1
- package/dist/js/treeshaking/schema/index.js +11 -12
- package/dist/js/treeshaking/schema/legacy.js +1 -4
- package/dist/js/treeshaking/utils/commands.js +5 -1
- package/dist/js/treeshaking/utils/env.js +13 -0
- package/dist/js/treeshaking/utils/getServerInternalPlugins.js +210 -0
- package/dist/types/analyze/Builder.d.ts +8 -0
- package/dist/types/analyze/constants.d.ts +13 -1
- package/dist/types/analyze/templates.d.ts +3 -1
- package/dist/types/analyze/utils.d.ts +2 -1
- package/dist/types/builder/builderPlugins/compatModern.d.ts +3 -3
- package/dist/types/builder/index.d.ts +2 -2
- package/dist/types/commands/index.d.ts +1 -1
- package/dist/types/commands/{start.d.ts → serve.d.ts} +0 -0
- package/dist/types/index.d.ts +5 -1
- package/dist/types/locale/en.d.ts +1 -1
- package/dist/types/locale/index.d.ts +2 -2
- package/dist/types/locale/zh.d.ts +1 -1
- package/dist/types/schema/Schema.d.ts +1 -1
- package/dist/types/types/config/deploy.d.ts +1 -1
- package/dist/types/types/config/dev.d.ts +4 -4
- package/dist/types/types/config/experiments.d.ts +3 -3
- package/dist/types/types/config/html.d.ts +3 -3
- package/dist/types/types/config/index.d.ts +6 -3
- package/dist/types/types/config/output.d.ts +6 -6
- package/dist/types/types/config/performance.d.ts +3 -3
- package/dist/types/types/config/security.d.ts +3 -3
- package/dist/types/types/config/source.d.ts +6 -5
- package/dist/types/types/config/tools.d.ts +3 -3
- package/dist/types/types/hooks.d.ts +9 -1
- package/dist/types/types/index.d.ts +6 -6
- package/dist/types/types/legacyConfig/deploy.d.ts +1 -1
- package/dist/types/types/legacyConfig/dev.d.ts +2 -2
- package/dist/types/types/legacyConfig/index.d.ts +1 -1
- package/dist/types/types/legacyConfig/output.d.ts +2 -2
- package/dist/types/types/legacyConfig/source.d.ts +1 -2
- package/dist/types/types/legacyConfig/tools.d.ts +2 -2
- package/dist/types/utils/commands.d.ts +2 -1
- package/dist/types/utils/env.d.ts +2 -0
- package/dist/types/utils/getServerInternalPlugins.d.ts +2 -0
- package/dist/types/utils/types.d.ts +5 -5
- package/package.json +27 -24
|
@@ -126,9 +126,10 @@ import { logger, chalk, isApiOnly } from "@modern-js/utils";
|
|
|
126
126
|
import server from "@modern-js/prod-server";
|
|
127
127
|
import { printInstructions } from "../utils/printInstructions";
|
|
128
128
|
import { injectDataLoaderPlugin } from "../utils/createServer";
|
|
129
|
+
import { getServerInternalPlugins } from "../utils/getServerInternalPlugins";
|
|
129
130
|
var start = function() {
|
|
130
131
|
var _ref = _asyncToGenerator(function(api) {
|
|
131
|
-
var ref, appContext, userConfig, hookRunners, appDirectory, port, serverConfigFile, apiOnly, app;
|
|
132
|
+
var ref, appContext, userConfig, hookRunners, appDirectory, port, serverConfigFile, apiOnly, serverInternalPlugins, app;
|
|
132
133
|
return __generator(this, function(_state) {
|
|
133
134
|
switch(_state.label){
|
|
134
135
|
case 0:
|
|
@@ -143,17 +144,23 @@ var start = function() {
|
|
|
143
144
|
];
|
|
144
145
|
case 1:
|
|
145
146
|
apiOnly = _state.sent();
|
|
147
|
+
return [
|
|
148
|
+
4,
|
|
149
|
+
getServerInternalPlugins(api)
|
|
150
|
+
];
|
|
151
|
+
case 2:
|
|
152
|
+
serverInternalPlugins = _state.sent();
|
|
146
153
|
return [
|
|
147
154
|
4,
|
|
148
155
|
server({
|
|
149
156
|
pwd: appDirectory,
|
|
150
157
|
config: userConfig,
|
|
151
158
|
serverConfigFile: serverConfigFile,
|
|
152
|
-
internalPlugins: injectDataLoaderPlugin(
|
|
159
|
+
internalPlugins: injectDataLoaderPlugin(serverInternalPlugins),
|
|
153
160
|
apiOnly: apiOnly
|
|
154
161
|
})
|
|
155
162
|
];
|
|
156
|
-
case
|
|
163
|
+
case 3:
|
|
157
164
|
app = _state.sent();
|
|
158
165
|
app.listen(port, function() {
|
|
159
166
|
var _ref = _asyncToGenerator(function(err) {
|
|
@@ -11,45 +11,64 @@ function _defineProperty(obj, key, value) {
|
|
|
11
11
|
}
|
|
12
12
|
return obj;
|
|
13
13
|
}
|
|
14
|
+
function _objectSpread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_defineProperty(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _objectSpreadProps(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
import { createDefaultConfig as createDefaultBuilderConfig } from "@modern-js/builder-webpack-provider";
|
|
14
54
|
function createDefaultConfig(appContext) {
|
|
55
|
+
var defaultBuilderConfig = createDefaultBuilderConfig();
|
|
56
|
+
var dev = _objectSpread({}, defaultBuilderConfig.dev);
|
|
57
|
+
var tools = _objectSpread({}, defaultBuilderConfig.tools);
|
|
58
|
+
var output = _objectSpreadProps(_objectSpread({}, defaultBuilderConfig.output), {
|
|
59
|
+
disableNodePolyfill: true
|
|
60
|
+
});
|
|
15
61
|
var _obj;
|
|
16
|
-
var
|
|
17
|
-
var source = {
|
|
62
|
+
var source = _objectSpreadProps(_objectSpread({}, defaultBuilderConfig.source), {
|
|
18
63
|
entries: void 0,
|
|
19
64
|
enableAsyncEntry: false,
|
|
20
65
|
disableDefaultEntries: false,
|
|
21
66
|
entriesDir: "./src",
|
|
22
67
|
configDir: "./config",
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
alias: defaultAlias
|
|
27
|
-
};
|
|
28
|
-
var output = {
|
|
29
|
-
assetPrefix: "/",
|
|
30
|
-
distPath: {
|
|
31
|
-
html: "html",
|
|
32
|
-
js: "static/js",
|
|
33
|
-
css: "static/css",
|
|
34
|
-
media: "static/media",
|
|
35
|
-
root: "dist"
|
|
36
|
-
},
|
|
37
|
-
copy: void 0,
|
|
38
|
-
disableCssModuleExtension: false,
|
|
39
|
-
enableCssModuleTSDeclaration: false,
|
|
40
|
-
disableMinimize: false,
|
|
41
|
-
enableInlineStyles: false,
|
|
42
|
-
enableInlineScripts: false,
|
|
43
|
-
disableSourceMap: false,
|
|
44
|
-
disableInlineRuntimeChunk: false,
|
|
45
|
-
disableFilenameHash: false,
|
|
46
|
-
enableLatestDecorators: false,
|
|
47
|
-
polyfill: "entry",
|
|
48
|
-
cssModuleLocalIdentName: void 0
|
|
49
|
-
};
|
|
50
|
-
var html = {
|
|
68
|
+
alias: (_obj = {}, _defineProperty(_obj, appContext.internalDirAlias, appContext.internalDirectory), _defineProperty(_obj, appContext.internalSrcAlias, appContext.srcDirectory), _defineProperty(_obj, "@", appContext.srcDirectory), _defineProperty(_obj, "@shared", appContext.sharedDirectory), _obj)
|
|
69
|
+
});
|
|
70
|
+
var html = _objectSpreadProps(_objectSpread({}, defaultBuilderConfig.html), {
|
|
51
71
|
title: "",
|
|
52
|
-
titleByEntries: void 0,
|
|
53
72
|
meta: {
|
|
54
73
|
charset: {
|
|
55
74
|
charset: "utf-8"
|
|
@@ -64,17 +83,8 @@ function createDefaultConfig(appContext) {
|
|
|
64
83
|
imagemode: "force",
|
|
65
84
|
"wap-font-scale": "no",
|
|
66
85
|
"format-detection": "telephone=no"
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
inject: "head",
|
|
70
|
-
injectByEntries: void 0,
|
|
71
|
-
mountId: "root",
|
|
72
|
-
favicon: "",
|
|
73
|
-
faviconByEntries: void 0,
|
|
74
|
-
disableHtmlFolder: false,
|
|
75
|
-
templateParameters: {},
|
|
76
|
-
templateParametersByEntries: void 0
|
|
77
|
-
};
|
|
86
|
+
}
|
|
87
|
+
});
|
|
78
88
|
var server = {
|
|
79
89
|
routes: void 0,
|
|
80
90
|
publicRoutes: void 0,
|
|
@@ -83,20 +93,6 @@ function createDefaultConfig(appContext) {
|
|
|
83
93
|
baseUrl: "/",
|
|
84
94
|
port: 8080
|
|
85
95
|
};
|
|
86
|
-
var dev = {
|
|
87
|
-
assetPrefix: false,
|
|
88
|
-
https: false
|
|
89
|
-
};
|
|
90
|
-
var tools = {
|
|
91
|
-
webpack: void 0,
|
|
92
|
-
babel: void 0,
|
|
93
|
-
postcss: void 0,
|
|
94
|
-
autoprefixer: void 0,
|
|
95
|
-
devServer: void 0,
|
|
96
|
-
tsLoader: void 0,
|
|
97
|
-
terser: void 0,
|
|
98
|
-
minifyCss: void 0
|
|
99
|
-
};
|
|
100
96
|
return {
|
|
101
97
|
source: source,
|
|
102
98
|
output: output,
|
|
@@ -105,6 +101,7 @@ function createDefaultConfig(appContext) {
|
|
|
105
101
|
html: html,
|
|
106
102
|
tools: tools,
|
|
107
103
|
plugins: [],
|
|
104
|
+
builderPlugins: [],
|
|
108
105
|
runtime: {},
|
|
109
106
|
runtimeByEntries: {}
|
|
110
107
|
};
|
|
@@ -19,6 +19,7 @@ function createOutputConfig(config) {
|
|
|
19
19
|
font: dataUriLimit,
|
|
20
20
|
media: dataUriLimit
|
|
21
21
|
},
|
|
22
|
+
cssModuleLocalIdentName: cssModuleLocalIdentName,
|
|
22
23
|
disableCssExtract: disableCssExtract,
|
|
23
24
|
disableCssModuleExtension: disableCssModuleExtension,
|
|
24
25
|
disableInlineRuntimeChunk: disableInlineRuntimeChunk,
|
|
@@ -31,9 +32,6 @@ function createOutputConfig(config) {
|
|
|
31
32
|
polyfill: polyfill,
|
|
32
33
|
disableFilenameHash: disableAssetsCache,
|
|
33
34
|
enableLatestDecorators: enableLatestDecorators,
|
|
34
|
-
filename: {
|
|
35
|
-
css: cssModuleLocalIdentName
|
|
36
|
-
},
|
|
37
35
|
ssg: ssg,
|
|
38
36
|
enableAssetFallback: true,
|
|
39
37
|
enableAssetManifest: true,
|
|
@@ -32,7 +32,11 @@ function createSourceConfig(config) {
|
|
|
32
32
|
enableAsyncEntry: enableAsyncEntry,
|
|
33
33
|
disableDefaultEntries: disableDefaultEntries,
|
|
34
34
|
entriesDir: entriesDir,
|
|
35
|
-
configDir: configDir
|
|
35
|
+
configDir: configDir,
|
|
36
|
+
resolveExtensionPrefix: {
|
|
37
|
+
web: ".web",
|
|
38
|
+
node: ".node"
|
|
39
|
+
}
|
|
36
40
|
};
|
|
37
41
|
}
|
|
38
42
|
export { createSourceConfig };
|
|
@@ -77,6 +77,7 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
77
77
|
}
|
|
78
78
|
import path, { dirname, isAbsolute, posix, sep } from "path";
|
|
79
79
|
import { applyOptionsChain, findExists, findMonorepoRoot, globby, isModernjsMonorepo } from "@modern-js/utils";
|
|
80
|
+
import { getAutoInjectEnv } from "../../utils/env";
|
|
80
81
|
function initHtmlConfig(config, appContext) {
|
|
81
82
|
var createBuilderAppIcon = function createBuilderAppIcon(config2, appContext2) {
|
|
82
83
|
var configDir = config2.source.configDir;
|
|
@@ -105,6 +106,11 @@ function initHtmlConfig(config, appContext) {
|
|
|
105
106
|
return config.html;
|
|
106
107
|
}
|
|
107
108
|
function initSourceConfig(config, appContext) {
|
|
109
|
+
var createBuilderGlobalVars = function createBuilderGlobalVars(config2, appContext2) {
|
|
110
|
+
var _source = config2.source, _globalVars = _source.globalVars, globalVars = _globalVars === void 0 ? {} : _globalVars;
|
|
111
|
+
var publicEnv = getAutoInjectEnv(appContext2);
|
|
112
|
+
return _objectSpread({}, globalVars, publicEnv);
|
|
113
|
+
};
|
|
108
114
|
var createBuilderInclude = function createBuilderInclude(config2, appContext2) {
|
|
109
115
|
var include = config2.source.include;
|
|
110
116
|
var defaultInclude = [
|
|
@@ -171,6 +177,7 @@ function initSourceConfig(config, appContext) {
|
|
|
171
177
|
};
|
|
172
178
|
config.source.include = createBuilderInclude(config, appContext);
|
|
173
179
|
config.source.moduleScopes = createBuilderModuleScope(config);
|
|
180
|
+
config.source.globalVars = createBuilderGlobalVars(config, appContext);
|
|
174
181
|
}
|
|
175
182
|
function initToolsConfig(config) {
|
|
176
183
|
var defaultTsChecker = {
|
|
@@ -21,11 +21,15 @@ function transformNormalizedConfig(config) {
|
|
|
21
21
|
server: server,
|
|
22
22
|
cliOptions: cliOptions,
|
|
23
23
|
testing: testing,
|
|
24
|
+
builderPlugins: [],
|
|
24
25
|
plugins: plugins,
|
|
25
26
|
security: {},
|
|
26
27
|
_raw: {},
|
|
27
28
|
experiments: {},
|
|
28
|
-
|
|
29
|
+
autoLoadPlugins: true,
|
|
30
|
+
performance: {
|
|
31
|
+
removeMomentLocale: true
|
|
32
|
+
}
|
|
29
33
|
};
|
|
30
34
|
}
|
|
31
35
|
export { transformNormalizedConfig };
|
|
@@ -10,6 +10,7 @@ var hooks = {
|
|
|
10
10
|
htmlPartials: createAsyncWaterfall(),
|
|
11
11
|
beforeGenerateRoutes: createAsyncWaterfall(),
|
|
12
12
|
addDefineTypes: createAsyncWaterfall(),
|
|
13
|
+
collectServerPlugins: createAsyncWaterfall(),
|
|
13
14
|
beforeDev: createAsyncWorkflow(),
|
|
14
15
|
afterDev: createAsyncWorkflow(),
|
|
15
16
|
beforeCreateCompiler: createAsyncWorkflow(),
|
|
@@ -21,6 +22,10 @@ var hooks = {
|
|
|
21
22
|
afterDeploy: createAsyncWorkflow(),
|
|
22
23
|
watchFiles: createParallelWorkflow(),
|
|
23
24
|
fileChange: createAsyncWorkflow(),
|
|
24
|
-
beforeRestart: createAsyncWorkflow()
|
|
25
|
+
beforeRestart: createAsyncWorkflow(),
|
|
26
|
+
registerDev: createParallelWorkflow(),
|
|
27
|
+
beforeDevTask: createParallelWorkflow(),
|
|
28
|
+
registerBuildPlatform: createParallelWorkflow(),
|
|
29
|
+
beforeBuildPlatform: createParallelWorkflow()
|
|
25
30
|
};
|
|
26
31
|
export { hooks };
|