@modern-js/app-tools 2.0.0-beta.0 → 2.0.0-beta.2
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 +375 -0
- package/dist/js/modern/analyze/generateCode.js +30 -38
- package/dist/js/modern/analyze/getBundleEntry.js +5 -13
- package/dist/js/modern/analyze/getClientRoutes/getRoutes.js +5 -30
- package/dist/js/modern/analyze/getClientRoutes/getRoutesLegacy.js +5 -30
- package/dist/js/modern/analyze/getClientRoutes/utils.js +0 -3
- package/dist/js/modern/analyze/getFileSystemEntry.js +5 -18
- package/dist/js/modern/analyze/getHtmlTemplate.js +3 -10
- package/dist/js/modern/analyze/getServerRoutes.js +25 -38
- package/dist/js/modern/analyze/index.js +90 -48
- package/dist/js/modern/analyze/isDefaultExportFunction.js +0 -4
- package/dist/js/modern/analyze/makeLegalIdentifier.js +0 -2
- package/dist/js/modern/analyze/nestedRoutes.js +8 -33
- package/dist/js/modern/analyze/templates.js +22 -37
- package/dist/js/modern/analyze/utils.js +0 -7
- package/dist/js/modern/builder/builderPlugins/compatModern.js +41 -58
- package/dist/js/modern/builder/index.js +56 -37
- package/dist/js/modern/builder/share.js +1 -5
- package/dist/js/modern/builder/webpackPlugins/htmlAsyncChunkPlugin.js +0 -8
- package/dist/js/modern/builder/webpackPlugins/htmlBottomTemplate.js +2 -13
- package/dist/js/modern/builder/webpackPlugins/routerPlugin.js +97 -0
- package/dist/js/modern/commands/build.js +12 -46
- package/dist/js/modern/commands/dev.js +20 -23
- package/dist/js/modern/commands/inspect.js +4 -19
- package/dist/js/modern/commands/start.js +1 -2
- package/dist/js/modern/config/default.js +207 -0
- package/dist/js/modern/config/index.js +2 -0
- package/dist/js/modern/config/initial/createHtmlConfig.js +32 -0
- package/dist/js/modern/{builder → config/initial}/createOutputConfig.js +19 -18
- package/dist/js/modern/config/initial/createSourceConfig.js +32 -0
- package/dist/js/modern/config/initial/createToolsConfig.js +41 -0
- package/dist/js/modern/config/initial/index.js +11 -0
- package/dist/js/modern/config/initial/inits.js +117 -0
- package/dist/js/modern/config/initial/transformNormalizedConfig.js +40 -0
- package/dist/js/modern/defineConfig.js +12 -0
- package/dist/js/modern/hooks.js +23 -19
- package/dist/js/modern/index.js +12 -19
- package/dist/js/modern/initialize/index.js +72 -0
- package/dist/js/modern/schema/Schema.js +39 -0
- package/dist/js/modern/schema/index.js +139 -0
- package/dist/js/modern/schema/legacy.js +284 -0
- package/dist/js/modern/types/config/deploy.js +0 -0
- package/dist/js/modern/types/config/dev.js +0 -0
- package/dist/js/modern/types/config/experiments.js +0 -0
- package/dist/js/modern/types/config/html.js +0 -0
- package/dist/js/modern/types/config/index.js +2 -0
- package/dist/js/modern/types/config/output.js +0 -0
- package/dist/js/modern/types/config/performance.js +0 -0
- package/dist/js/modern/types/config/security.js +0 -0
- package/dist/js/modern/types/config/source.js +0 -0
- package/dist/js/modern/types/config/tools.js +0 -0
- package/dist/js/modern/types/hooks.js +0 -0
- package/dist/js/modern/types/index.js +4 -0
- package/dist/js/modern/types/legacyConfig/deploy.js +0 -0
- package/dist/js/modern/types/legacyConfig/dev.js +0 -0
- package/dist/js/modern/types/legacyConfig/index.js +0 -0
- package/dist/js/modern/types/legacyConfig/output.js +1 -0
- package/dist/js/modern/types/legacyConfig/source.js +0 -0
- package/dist/js/modern/types/legacyConfig/tools.js +0 -0
- package/dist/js/modern/utils/config.js +2 -13
- package/dist/js/modern/utils/createFileWatcher.js +82 -0
- package/dist/js/modern/utils/createServer.js +0 -5
- package/dist/js/modern/utils/getSpecifiedEntries.js +0 -6
- package/dist/js/modern/utils/printInstructions.js +2 -1
- package/dist/js/modern/utils/restart.js +17 -0
- package/dist/js/modern/utils/routes.js +0 -2
- package/dist/js/node/analyze/generateCode.js +30 -61
- package/dist/js/node/analyze/getBundleEntry.js +5 -19
- package/dist/js/node/analyze/getClientRoutes/getRoutes.js +5 -45
- package/dist/js/node/analyze/getClientRoutes/getRoutesLegacy.js +5 -45
- package/dist/js/node/analyze/getClientRoutes/index.js +0 -2
- package/dist/js/node/analyze/getClientRoutes/utils.js +0 -14
- package/dist/js/node/analyze/getFileSystemEntry.js +5 -26
- package/dist/js/node/analyze/getHtmlTemplate.js +3 -24
- package/dist/js/node/analyze/getServerRoutes.js +24 -46
- package/dist/js/node/analyze/index.js +91 -70
- package/dist/js/node/analyze/isDefaultExportFunction.js +0 -12
- package/dist/js/node/analyze/makeLegalIdentifier.js +0 -4
- package/dist/js/node/analyze/nestedRoutes.js +8 -41
- package/dist/js/node/analyze/templates.js +22 -47
- package/dist/js/node/analyze/utils.js +0 -20
- package/dist/js/node/builder/builderPlugins/compatModern.js +41 -69
- package/dist/js/node/builder/index.js +57 -51
- package/dist/js/node/builder/share.js +1 -13
- package/dist/js/node/builder/webpackPlugins/htmlAsyncChunkPlugin.js +0 -10
- package/dist/js/node/builder/webpackPlugins/htmlBottomTemplate.js +2 -15
- package/dist/js/node/builder/webpackPlugins/routerPlugin.js +105 -0
- package/dist/js/node/commands/build.js +10 -57
- package/dist/js/node/commands/deploy.js +0 -2
- package/dist/js/node/commands/dev.js +19 -34
- package/dist/js/node/commands/index.js +0 -6
- package/dist/js/node/commands/inspect.js +4 -26
- package/dist/js/node/commands/start.js +1 -11
- package/dist/js/node/config/default.js +214 -0
- package/dist/js/node/config/index.js +31 -0
- package/dist/js/node/config/initial/createHtmlConfig.js +38 -0
- package/dist/js/node/{builder → config/initial}/createOutputConfig.js +19 -20
- package/dist/js/node/config/initial/createSourceConfig.js +38 -0
- package/dist/js/node/config/initial/createToolsConfig.js +47 -0
- package/dist/js/node/config/initial/index.js +24 -0
- package/dist/js/node/config/initial/inits.js +127 -0
- package/dist/js/node/config/initial/transformNormalizedConfig.js +46 -0
- package/dist/js/node/defineConfig.js +20 -0
- package/dist/js/node/exports/server.js +0 -1
- package/dist/js/node/hooks.js +23 -30
- package/dist/js/node/index.js +35 -48
- package/dist/js/node/initialize/index.js +79 -0
- package/dist/js/node/locale/index.js +0 -4
- package/dist/js/node/schema/Schema.js +46 -0
- package/dist/js/node/schema/index.js +152 -0
- package/dist/js/node/schema/legacy.js +291 -0
- package/dist/js/node/types/config/deploy.js +0 -0
- package/dist/js/node/types/config/dev.js +0 -0
- package/dist/js/node/types/config/experiments.js +0 -0
- package/dist/js/node/types/config/html.js +0 -0
- package/dist/js/node/types/config/index.js +16 -0
- package/dist/js/node/types/config/output.js +0 -0
- package/dist/js/node/types/config/performance.js +0 -0
- package/dist/js/node/types/config/security.js +0 -0
- package/dist/js/node/types/config/source.js +0 -0
- package/dist/js/node/types/config/tools.js +0 -0
- package/dist/js/node/types/hooks.js +0 -0
- package/dist/js/node/types/index.js +38 -0
- package/dist/js/node/types/legacyConfig/deploy.js +0 -0
- package/dist/js/node/types/legacyConfig/dev.js +0 -0
- package/dist/js/node/types/legacyConfig/index.js +0 -0
- package/dist/js/node/types/legacyConfig/output.js +5 -0
- package/dist/js/node/types/legacyConfig/source.js +0 -0
- package/dist/js/node/types/legacyConfig/tools.js +0 -0
- package/dist/js/node/utils/commands.js +0 -2
- package/dist/js/node/utils/config.js +2 -26
- package/dist/js/node/utils/createFileWatcher.js +90 -0
- package/dist/js/node/utils/createServer.js +0 -15
- package/dist/js/node/utils/getSpecifiedEntries.js +0 -9
- package/dist/js/node/utils/language.js +0 -2
- package/dist/js/node/utils/printInstructions.js +2 -5
- package/dist/js/node/utils/restart.js +23 -0
- package/dist/js/node/utils/routes.js +0 -5
- package/dist/js/treeshaking/analyze/generateCode.js +58 -101
- package/dist/js/treeshaking/analyze/getBundleEntry.js +12 -20
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutes.js +16 -42
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutesLegacy.js +16 -42
- package/dist/js/treeshaking/analyze/getClientRoutes/utils.js +0 -3
- package/dist/js/treeshaking/analyze/getFileSystemEntry.js +5 -18
- package/dist/js/treeshaking/analyze/getHtmlTemplate.js +3 -27
- package/dist/js/treeshaking/analyze/getServerRoutes.js +29 -41
- package/dist/js/treeshaking/analyze/index.js +195 -91
- package/dist/js/treeshaking/analyze/isDefaultExportFunction.js +0 -4
- package/dist/js/treeshaking/analyze/makeLegalIdentifier.js +0 -2
- package/dist/js/treeshaking/analyze/nestedRoutes.js +9 -51
- package/dist/js/treeshaking/analyze/templates.js +31 -50
- package/dist/js/treeshaking/analyze/utils.js +7 -14
- package/dist/js/treeshaking/builder/builderPlugins/compatModern.js +50 -68
- package/dist/js/treeshaking/builder/index.js +69 -65
- package/dist/js/treeshaking/builder/share.js +1 -5
- package/dist/js/treeshaking/builder/webpackPlugins/htmlAsyncChunkPlugin.js +1 -13
- package/dist/js/treeshaking/builder/webpackPlugins/htmlBottomTemplate.js +2 -14
- package/dist/js/treeshaking/builder/webpackPlugins/routerPlugin.js +121 -0
- package/dist/js/treeshaking/commands/build.js +41 -116
- package/dist/js/treeshaking/commands/deploy.js +0 -3
- package/dist/js/treeshaking/commands/dev.js +38 -46
- package/dist/js/treeshaking/commands/inspect.js +9 -27
- package/dist/js/treeshaking/commands/start.js +1 -9
- package/dist/js/treeshaking/config/default.js +200 -0
- package/dist/js/treeshaking/config/index.js +2 -0
- package/dist/js/treeshaking/config/initial/createHtmlConfig.js +31 -0
- package/dist/js/treeshaking/config/initial/createOutputConfig.js +67 -0
- package/dist/js/treeshaking/config/initial/createSourceConfig.js +41 -0
- package/dist/js/treeshaking/config/initial/createToolsConfig.js +38 -0
- package/dist/js/treeshaking/config/initial/index.js +11 -0
- package/dist/js/treeshaking/config/initial/inits.js +114 -0
- package/dist/js/treeshaking/config/initial/transformNormalizedConfig.js +38 -0
- package/dist/js/treeshaking/defineConfig.js +14 -0
- package/dist/js/treeshaking/hooks.js +23 -19
- package/dist/js/treeshaking/index.js +8 -43
- package/dist/js/treeshaking/initialize/index.js +121 -0
- package/dist/js/treeshaking/schema/Schema.js +75 -0
- package/dist/js/treeshaking/schema/index.js +138 -0
- package/dist/js/treeshaking/schema/legacy.js +273 -0
- package/dist/js/treeshaking/types/config/deploy.js +0 -0
- package/dist/js/treeshaking/types/config/dev.js +0 -0
- package/dist/js/treeshaking/types/config/experiments.js +0 -0
- package/dist/js/treeshaking/types/config/html.js +0 -0
- package/dist/js/treeshaking/types/config/index.js +2 -0
- package/dist/js/treeshaking/types/config/output.js +0 -0
- package/dist/js/treeshaking/types/config/performance.js +0 -0
- package/dist/js/treeshaking/types/config/security.js +0 -0
- package/dist/js/treeshaking/types/config/source.js +0 -0
- package/dist/js/treeshaking/types/config/tools.js +0 -0
- package/dist/js/treeshaking/types/hooks.js +0 -0
- package/dist/js/treeshaking/types/index.js +4 -0
- package/dist/js/treeshaking/types/legacyConfig/deploy.js +0 -0
- package/dist/js/treeshaking/types/legacyConfig/dev.js +0 -0
- package/dist/js/treeshaking/types/legacyConfig/index.js +0 -0
- package/dist/js/treeshaking/types/legacyConfig/output.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/source.js +0 -0
- package/dist/js/treeshaking/types/legacyConfig/tools.js +0 -0
- package/dist/js/treeshaking/utils/config.js +2 -18
- package/dist/js/treeshaking/utils/createFileWatcher.js +123 -0
- package/dist/js/treeshaking/utils/createServer.js +0 -10
- package/dist/js/treeshaking/utils/getSpecifiedEntries.js +0 -10
- package/dist/js/treeshaking/utils/printInstructions.js +0 -5
- package/dist/js/treeshaking/utils/restart.js +45 -0
- package/dist/js/treeshaking/utils/routes.js +0 -4
- package/dist/types/analyze/generateCode.d.ts +3 -2
- package/dist/types/analyze/getBundleEntry.d.ts +2 -2
- package/dist/types/analyze/getFileSystemEntry.d.ts +2 -2
- package/dist/types/analyze/getHtmlTemplate.d.ts +3 -3
- package/dist/types/analyze/getServerRoutes.d.ts +3 -2
- package/dist/types/analyze/index.d.ts +3 -42
- package/dist/types/analyze/nestedRoutes.d.ts +1 -1
- package/dist/types/analyze/templates.d.ts +4 -2
- package/dist/types/analyze/utils.d.ts +1 -1
- package/dist/types/builder/builderPlugins/compatModern.d.ts +2 -3
- package/dist/types/builder/index.d.ts +7 -8
- package/dist/types/builder/share.d.ts +2 -2
- package/dist/types/builder/webpackPlugins/routerPlugin.d.ts +10 -0
- package/dist/types/commands/build.d.ts +2 -2
- package/dist/types/commands/deploy.d.ts +2 -2
- package/dist/types/commands/dev.d.ts +2 -2
- package/dist/types/commands/inspect.d.ts +6 -1
- package/dist/types/commands/start.d.ts +2 -2
- package/dist/types/config/default.d.ts +3 -0
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/config/initial/createHtmlConfig.d.ts +2 -0
- package/dist/types/config/initial/createOutputConfig.d.ts +2 -0
- package/dist/types/config/initial/createSourceConfig.d.ts +2 -0
- package/dist/types/config/initial/createToolsConfig.d.ts +2 -0
- package/dist/types/config/initial/index.d.ts +4 -0
- package/dist/types/config/initial/inits.d.ts +4 -0
- package/dist/types/config/initial/transformNormalizedConfig.d.ts +2 -0
- package/dist/types/defineConfig.d.ts +7 -0
- package/dist/types/hooks.d.ts +2 -42
- package/dist/types/index.d.ts +5 -7
- package/dist/types/initialize/index.d.ts +3 -0
- package/dist/types/schema/Schema.d.ts +14 -0
- package/dist/types/schema/index.d.ts +4 -0
- package/dist/types/schema/legacy.d.ts +3 -0
- package/dist/types/types/config/deploy.d.ts +9 -0
- package/dist/types/types/config/dev.d.ts +13 -0
- package/dist/types/types/config/experiments.d.ts +4 -0
- package/dist/types/types/config/html.d.ts +4 -0
- package/dist/types/types/config/index.d.ts +62 -0
- package/dist/types/types/config/output.d.ts +23 -0
- package/dist/types/types/config/performance.d.ts +4 -0
- package/dist/types/types/config/security.d.ts +4 -0
- package/dist/types/types/config/source.d.ts +22 -0
- package/dist/types/types/config/tools.d.ts +15 -0
- package/dist/types/types/hooks.d.ts +80 -0
- package/dist/types/types/index.d.ts +23 -0
- package/dist/types/types/legacyConfig/deploy.d.ts +8 -0
- package/dist/types/types/legacyConfig/dev.d.ts +12 -0
- package/dist/types/types/legacyConfig/index.d.ts +33 -0
- package/dist/types/types/legacyConfig/output.d.ts +51 -0
- package/dist/types/types/legacyConfig/source.d.ts +25 -0
- package/dist/types/types/legacyConfig/tools.d.ts +16 -0
- package/dist/types/utils/config.d.ts +2 -3
- package/dist/types/utils/createFileWatcher.d.ts +3 -0
- package/dist/types/utils/printInstructions.d.ts +3 -3
- package/dist/types/utils/restart.d.ts +3 -0
- package/package.json +26 -25
- package/dist/js/modern/builder/createHtmlConfig.js +0 -58
- package/dist/js/modern/builder/createSourceConfig.js +0 -85
- package/dist/js/modern/builder/createToolsConfig.js +0 -94
- package/dist/js/modern/utils/createCompiler.js +0 -58
- package/dist/js/node/builder/createHtmlConfig.js +0 -76
- package/dist/js/node/builder/createSourceConfig.js +0 -99
- package/dist/js/node/builder/createToolsConfig.js +0 -103
- package/dist/js/node/utils/createCompiler.js +0 -75
- package/dist/js/treeshaking/builder/createHtmlConfig.js +0 -59
- package/dist/js/treeshaking/builder/createOutputConfig.js +0 -67
- package/dist/js/treeshaking/builder/createSourceConfig.js +0 -100
- package/dist/js/treeshaking/builder/createToolsConfig.js +0 -90
- package/dist/js/treeshaking/utils/createCompiler.js +0 -117
- package/dist/types/builder/createHtmlConfig.d.ts +0 -6
- package/dist/types/builder/createOutputConfig.d.ts +0 -3
- package/dist/types/builder/createSourceConfig.d.ts +0 -5
- package/dist/types/builder/createToolsConfig.d.ts +0 -13
- package/dist/types/utils/createCompiler.d.ts +0 -12
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
export function createDefaultConfig(appContext) {
|
|
3
|
+
var _ref;
|
|
4
|
+
var defaultAlias = appContext ? (_ref = {}, _defineProperty(_ref, appContext.internalDirAlias, appContext.internalDirectory), _defineProperty(_ref, appContext.internalSrcAlias, appContext.srcDirectory), _defineProperty(_ref, '@', appContext.srcDirectory), _defineProperty(_ref, '@shared', appContext.sharedDirectory), _ref) : {};
|
|
5
|
+
var source = {
|
|
6
|
+
entries: undefined,
|
|
7
|
+
enableAsyncEntry: false,
|
|
8
|
+
disableDefaultEntries: false,
|
|
9
|
+
entriesDir: './src',
|
|
10
|
+
configDir: './config',
|
|
11
|
+
globalVars: undefined,
|
|
12
|
+
moduleScopes: undefined,
|
|
13
|
+
include: [],
|
|
14
|
+
alias: defaultAlias
|
|
15
|
+
};
|
|
16
|
+
var output = {
|
|
17
|
+
assetPrefix: '/',
|
|
18
|
+
distPath: {
|
|
19
|
+
html: 'html',
|
|
20
|
+
js: 'static/js',
|
|
21
|
+
css: 'static/css',
|
|
22
|
+
media: 'static/media',
|
|
23
|
+
root: 'dist'
|
|
24
|
+
},
|
|
25
|
+
copy: undefined,
|
|
26
|
+
disableCssModuleExtension: false,
|
|
27
|
+
enableCssModuleTSDeclaration: false,
|
|
28
|
+
disableMinimize: false,
|
|
29
|
+
enableInlineStyles: false,
|
|
30
|
+
enableInlineScripts: false,
|
|
31
|
+
disableSourceMap: false,
|
|
32
|
+
disableInlineRuntimeChunk: false,
|
|
33
|
+
disableFilenameHash: false,
|
|
34
|
+
enableLatestDecorators: false,
|
|
35
|
+
polyfill: 'entry',
|
|
36
|
+
dataUriLimit: 10000,
|
|
37
|
+
cssModuleLocalIdentName: undefined
|
|
38
|
+
};
|
|
39
|
+
var html = {
|
|
40
|
+
title: '',
|
|
41
|
+
titleByEntries: undefined,
|
|
42
|
+
meta: {
|
|
43
|
+
charset: {
|
|
44
|
+
charset: 'utf-8'
|
|
45
|
+
},
|
|
46
|
+
viewport: 'width=device-width, initial-scale=1.0, shrink-to-fit=no, viewport-fit=cover, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no',
|
|
47
|
+
'http-equiv': {
|
|
48
|
+
'http-equiv': 'x-ua-compatible',
|
|
49
|
+
content: 'ie=edge'
|
|
50
|
+
},
|
|
51
|
+
renderer: 'webkit',
|
|
52
|
+
layoutmode: 'standard',
|
|
53
|
+
imagemode: 'force',
|
|
54
|
+
'wap-font-scale': 'no',
|
|
55
|
+
'format-detection': 'telephone=no'
|
|
56
|
+
},
|
|
57
|
+
metaByEntries: undefined,
|
|
58
|
+
inject: 'head',
|
|
59
|
+
injectByEntries: undefined,
|
|
60
|
+
mountId: 'root',
|
|
61
|
+
favicon: '',
|
|
62
|
+
faviconByEntries: undefined,
|
|
63
|
+
disableHtmlFolder: false,
|
|
64
|
+
templateParameters: {},
|
|
65
|
+
templateParametersByEntries: undefined
|
|
66
|
+
};
|
|
67
|
+
var server = {
|
|
68
|
+
routes: undefined,
|
|
69
|
+
publicRoutes: undefined,
|
|
70
|
+
ssr: undefined,
|
|
71
|
+
ssrByEntries: undefined,
|
|
72
|
+
baseUrl: '/',
|
|
73
|
+
port: 8080
|
|
74
|
+
};
|
|
75
|
+
var dev = {
|
|
76
|
+
assetPrefix: false,
|
|
77
|
+
https: false
|
|
78
|
+
};
|
|
79
|
+
var tools = {
|
|
80
|
+
webpack: undefined,
|
|
81
|
+
babel: undefined,
|
|
82
|
+
postcss: undefined,
|
|
83
|
+
autoprefixer: undefined,
|
|
84
|
+
devServer: undefined,
|
|
85
|
+
tsLoader: undefined,
|
|
86
|
+
terser: undefined,
|
|
87
|
+
minifyCss: undefined
|
|
88
|
+
};
|
|
89
|
+
return {
|
|
90
|
+
source: source,
|
|
91
|
+
output: output,
|
|
92
|
+
server: server,
|
|
93
|
+
dev: dev,
|
|
94
|
+
html: html,
|
|
95
|
+
tools: tools,
|
|
96
|
+
plugins: [],
|
|
97
|
+
runtime: {},
|
|
98
|
+
runtimeByEntries: {}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export function createLegacyDefaultConfig(appContext) {
|
|
102
|
+
var _ref2;
|
|
103
|
+
var defaultAlias = appContext ? (_ref2 = {}, _defineProperty(_ref2, appContext.internalDirAlias, appContext.internalDirectory), _defineProperty(_ref2, appContext.internalSrcAlias, appContext.srcDirectory), _defineProperty(_ref2, '@', appContext.srcDirectory), _defineProperty(_ref2, '@shared', appContext.sharedDirectory), _ref2) : {};
|
|
104
|
+
var sourceDefaults = {
|
|
105
|
+
entries: undefined,
|
|
106
|
+
enableAsyncEntry: false,
|
|
107
|
+
disableDefaultEntries: false,
|
|
108
|
+
entriesDir: './src',
|
|
109
|
+
configDir: './config',
|
|
110
|
+
apiDir: './api',
|
|
111
|
+
envVars: [],
|
|
112
|
+
globalVars: undefined,
|
|
113
|
+
alias: defaultAlias,
|
|
114
|
+
moduleScopes: undefined,
|
|
115
|
+
include: []
|
|
116
|
+
};
|
|
117
|
+
var outputDefaults = {
|
|
118
|
+
assetPrefix: '/',
|
|
119
|
+
htmlPath: 'html',
|
|
120
|
+
jsPath: 'static/js',
|
|
121
|
+
cssPath: 'static/css',
|
|
122
|
+
mediaPath: 'static/media',
|
|
123
|
+
path: 'dist',
|
|
124
|
+
title: '',
|
|
125
|
+
titleByEntries: undefined,
|
|
126
|
+
meta: {
|
|
127
|
+
charset: {
|
|
128
|
+
charset: 'utf-8'
|
|
129
|
+
},
|
|
130
|
+
viewport: 'width=device-width, initial-scale=1.0, shrink-to-fit=no, viewport-fit=cover, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no',
|
|
131
|
+
'http-equiv': {
|
|
132
|
+
'http-equiv': 'x-ua-compatible',
|
|
133
|
+
content: 'ie=edge'
|
|
134
|
+
},
|
|
135
|
+
renderer: 'webkit',
|
|
136
|
+
layoutmode: 'standard',
|
|
137
|
+
imagemode: 'force',
|
|
138
|
+
'wap-font-scale': 'no',
|
|
139
|
+
'format-detection': 'telephone=no'
|
|
140
|
+
},
|
|
141
|
+
metaByEntries: undefined,
|
|
142
|
+
inject: 'head',
|
|
143
|
+
injectByEntries: undefined,
|
|
144
|
+
mountId: 'root',
|
|
145
|
+
favicon: '',
|
|
146
|
+
faviconByEntries: undefined,
|
|
147
|
+
copy: undefined,
|
|
148
|
+
disableHtmlFolder: false,
|
|
149
|
+
disableCssModuleExtension: false,
|
|
150
|
+
disableCssExtract: false,
|
|
151
|
+
enableCssModuleTSDeclaration: false,
|
|
152
|
+
disableMinimize: false,
|
|
153
|
+
enableInlineStyles: false,
|
|
154
|
+
enableInlineScripts: false,
|
|
155
|
+
disableSourceMap: false,
|
|
156
|
+
disableInlineRuntimeChunk: false,
|
|
157
|
+
disableAssetsCache: false,
|
|
158
|
+
enableLatestDecorators: false,
|
|
159
|
+
polyfill: 'entry',
|
|
160
|
+
dataUriLimit: 10000,
|
|
161
|
+
templateParameters: {},
|
|
162
|
+
templateParametersByEntries: undefined,
|
|
163
|
+
cssModuleLocalIdentName: undefined,
|
|
164
|
+
enableModernMode: false,
|
|
165
|
+
disableNodePolyfill: false,
|
|
166
|
+
enableTsLoader: false
|
|
167
|
+
};
|
|
168
|
+
var serverDefaults = {
|
|
169
|
+
routes: undefined,
|
|
170
|
+
publicRoutes: undefined,
|
|
171
|
+
ssr: undefined,
|
|
172
|
+
ssrByEntries: undefined,
|
|
173
|
+
baseUrl: '/',
|
|
174
|
+
port: 8080
|
|
175
|
+
};
|
|
176
|
+
var devDefaults = {
|
|
177
|
+
assetPrefix: false,
|
|
178
|
+
https: false
|
|
179
|
+
};
|
|
180
|
+
var toolsDefaults = {
|
|
181
|
+
webpack: undefined,
|
|
182
|
+
babel: undefined,
|
|
183
|
+
postcss: undefined,
|
|
184
|
+
autoprefixer: undefined,
|
|
185
|
+
lodash: undefined,
|
|
186
|
+
devServer: undefined,
|
|
187
|
+
tsLoader: undefined,
|
|
188
|
+
terser: undefined,
|
|
189
|
+
minifyCss: undefined
|
|
190
|
+
};
|
|
191
|
+
return {
|
|
192
|
+
source: sourceDefaults,
|
|
193
|
+
output: outputDefaults,
|
|
194
|
+
server: serverDefaults,
|
|
195
|
+
dev: devDefaults,
|
|
196
|
+
tools: toolsDefaults,
|
|
197
|
+
runtime: {},
|
|
198
|
+
runtimeByEntries: {}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function createHtmlConfig(config) {
|
|
2
|
+
var _config$output = config.output,
|
|
3
|
+
disableHtmlFolder = _config$output.disableHtmlFolder,
|
|
4
|
+
favicon = _config$output.favicon,
|
|
5
|
+
faviconByEntries = _config$output.faviconByEntries,
|
|
6
|
+
inject = _config$output.inject,
|
|
7
|
+
injectByEntries = _config$output.injectByEntries,
|
|
8
|
+
meta = _config$output.meta,
|
|
9
|
+
metaByEntries = _config$output.metaByEntries,
|
|
10
|
+
mountId = _config$output.mountId,
|
|
11
|
+
title = _config$output.title,
|
|
12
|
+
titleByEntries = _config$output.titleByEntries,
|
|
13
|
+
templateParameters = _config$output.templateParameters,
|
|
14
|
+
templateParametersByEntries = _config$output.templateParametersByEntries,
|
|
15
|
+
crossorigin = _config$output.crossorigin;
|
|
16
|
+
return {
|
|
17
|
+
disableHtmlFolder: disableHtmlFolder,
|
|
18
|
+
favicon: favicon,
|
|
19
|
+
faviconByEntries: faviconByEntries,
|
|
20
|
+
inject: inject,
|
|
21
|
+
injectByEntries: injectByEntries,
|
|
22
|
+
meta: meta,
|
|
23
|
+
metaByEntries: metaByEntries,
|
|
24
|
+
mountId: mountId,
|
|
25
|
+
title: title,
|
|
26
|
+
titleByEntries: titleByEntries,
|
|
27
|
+
crossorigin: crossorigin,
|
|
28
|
+
templateParameters: templateParameters,
|
|
29
|
+
templateParametersByEntries: templateParametersByEntries
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export function createOutputConfig(config) {
|
|
2
|
+
var _config$output = config.output,
|
|
3
|
+
assetPrefix = _config$output.assetPrefix,
|
|
4
|
+
copy = _config$output.copy,
|
|
5
|
+
cssModuleLocalIdentName = _config$output.cssModuleLocalIdentName,
|
|
6
|
+
cssPath = _config$output.cssPath,
|
|
7
|
+
jsPath = _config$output.jsPath,
|
|
8
|
+
htmlPath = _config$output.htmlPath,
|
|
9
|
+
mediaPath = _config$output.mediaPath,
|
|
10
|
+
enableTsLoader = _config$output.enableTsLoader,
|
|
11
|
+
path = _config$output.path,
|
|
12
|
+
disableInlineRuntimeChunk = _config$output.disableInlineRuntimeChunk,
|
|
13
|
+
disableCssExtract = _config$output.disableCssExtract,
|
|
14
|
+
disableMinimize = _config$output.disableMinimize,
|
|
15
|
+
disableSourceMap = _config$output.disableSourceMap,
|
|
16
|
+
disableTsChecker = _config$output.disableTsChecker,
|
|
17
|
+
enableCssModuleTSDeclaration = _config$output.enableCssModuleTSDeclaration,
|
|
18
|
+
enableInlineScripts = _config$output.enableInlineScripts,
|
|
19
|
+
enableInlineStyles = _config$output.enableInlineStyles,
|
|
20
|
+
polyfill = _config$output.polyfill,
|
|
21
|
+
dataUriLimit = _config$output.dataUriLimit,
|
|
22
|
+
disableAssetsCache = _config$output.disableAssetsCache,
|
|
23
|
+
enableLatestDecorators = _config$output.enableLatestDecorators,
|
|
24
|
+
disableCssModuleExtension = _config$output.disableCssModuleExtension,
|
|
25
|
+
ssg = _config$output.ssg,
|
|
26
|
+
enableModernMode = _config$output.enableModernMode,
|
|
27
|
+
disableNodePolyfill = _config$output.disableNodePolyfill;
|
|
28
|
+
return {
|
|
29
|
+
assetPrefix: assetPrefix,
|
|
30
|
+
copy: copy,
|
|
31
|
+
distPath: {
|
|
32
|
+
root: path,
|
|
33
|
+
css: cssPath,
|
|
34
|
+
js: jsPath,
|
|
35
|
+
html: htmlPath,
|
|
36
|
+
// `@modern-js/webpack` output all media files to `dist/media` by default
|
|
37
|
+
svg: mediaPath || 'media',
|
|
38
|
+
image: mediaPath || 'media',
|
|
39
|
+
font: mediaPath || 'media',
|
|
40
|
+
media: mediaPath || 'media'
|
|
41
|
+
},
|
|
42
|
+
dataUriLimit: {
|
|
43
|
+
svg: dataUriLimit,
|
|
44
|
+
image: dataUriLimit,
|
|
45
|
+
font: dataUriLimit,
|
|
46
|
+
media: dataUriLimit
|
|
47
|
+
},
|
|
48
|
+
disableCssExtract: disableCssExtract,
|
|
49
|
+
disableCssModuleExtension: disableCssModuleExtension,
|
|
50
|
+
disableInlineRuntimeChunk: disableInlineRuntimeChunk,
|
|
51
|
+
disableMinimize: disableMinimize,
|
|
52
|
+
disableSourceMap: disableSourceMap,
|
|
53
|
+
disableTsChecker: disableTsChecker || enableTsLoader,
|
|
54
|
+
enableCssModuleTSDeclaration: enableCssModuleTSDeclaration,
|
|
55
|
+
enableInlineScripts: enableInlineScripts,
|
|
56
|
+
enableInlineStyles: enableInlineStyles,
|
|
57
|
+
polyfill: polyfill,
|
|
58
|
+
disableFilenameHash: disableAssetsCache,
|
|
59
|
+
enableLatestDecorators: enableLatestDecorators,
|
|
60
|
+
filename: {
|
|
61
|
+
css: cssModuleLocalIdentName
|
|
62
|
+
},
|
|
63
|
+
ssg: ssg,
|
|
64
|
+
enableModernMode: enableModernMode,
|
|
65
|
+
disableNodePolyfill: disableNodePolyfill
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
2
|
+
export function createSourceConfig(config) {
|
|
3
|
+
var _config$source = config.source,
|
|
4
|
+
alias = _config$source.alias,
|
|
5
|
+
envVars = _config$source.envVars,
|
|
6
|
+
globalVars = _config$source.globalVars,
|
|
7
|
+
include = _config$source.include,
|
|
8
|
+
moduleScopes = _config$source.moduleScopes,
|
|
9
|
+
preEntry = _config$source.preEntry,
|
|
10
|
+
entries = _config$source.entries,
|
|
11
|
+
enableAsyncEntry = _config$source.enableAsyncEntry,
|
|
12
|
+
disableDefaultEntries = _config$source.disableDefaultEntries,
|
|
13
|
+
entriesDir = _config$source.entriesDir,
|
|
14
|
+
configDir = _config$source.configDir;
|
|
15
|
+
var builderGlobalVars = globalVars || {};
|
|
16
|
+
var _iterator = _createForOfIteratorHelper(envVars || []),
|
|
17
|
+
_step;
|
|
18
|
+
try {
|
|
19
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
20
|
+
var envVar = _step.value;
|
|
21
|
+
var envVarValue = process.env[envVar];
|
|
22
|
+
envVarValue && (builderGlobalVars["process.env.".concat(envVar)] = envVarValue);
|
|
23
|
+
}
|
|
24
|
+
} catch (err) {
|
|
25
|
+
_iterator.e(err);
|
|
26
|
+
} finally {
|
|
27
|
+
_iterator.f();
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
alias: alias,
|
|
31
|
+
moduleScopes: moduleScopes,
|
|
32
|
+
globalVars: builderGlobalVars,
|
|
33
|
+
include: include,
|
|
34
|
+
preEntry: preEntry,
|
|
35
|
+
entries: entries,
|
|
36
|
+
enableAsyncEntry: enableAsyncEntry,
|
|
37
|
+
disableDefaultEntries: disableDefaultEntries,
|
|
38
|
+
entriesDir: entriesDir,
|
|
39
|
+
configDir: configDir
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function createToolsConfig(config) {
|
|
2
|
+
var _config$tools = config.tools,
|
|
3
|
+
autoprefixer = _config$tools.autoprefixer,
|
|
4
|
+
babel = _config$tools.babel,
|
|
5
|
+
minifyCss = _config$tools.minifyCss,
|
|
6
|
+
terser = _config$tools.terser,
|
|
7
|
+
webpack = _config$tools.webpack,
|
|
8
|
+
webpackChain = _config$tools.webpackChain,
|
|
9
|
+
tsLoader = _config$tools.tsLoader,
|
|
10
|
+
styledComponents = _config$tools.styledComponents,
|
|
11
|
+
sass = _config$tools.sass,
|
|
12
|
+
postcss = _config$tools.postcss,
|
|
13
|
+
less = _config$tools.less,
|
|
14
|
+
htmlPlugin = _config$tools.htmlPlugin,
|
|
15
|
+
devServer = _config$tools.devServer,
|
|
16
|
+
tailwindcss = _config$tools.tailwindcss,
|
|
17
|
+
jest = _config$tools.jest,
|
|
18
|
+
esbuild = _config$tools.esbuild;
|
|
19
|
+
var enableTsLoader = config.output.enableTsLoader;
|
|
20
|
+
return {
|
|
21
|
+
tsLoader: enableTsLoader ? tsLoader : undefined,
|
|
22
|
+
autoprefixer: autoprefixer,
|
|
23
|
+
babel: babel,
|
|
24
|
+
minifyCss: minifyCss,
|
|
25
|
+
terser: terser,
|
|
26
|
+
webpack: webpack,
|
|
27
|
+
webpackChain: webpackChain,
|
|
28
|
+
styledComponents: styledComponents,
|
|
29
|
+
sass: sass,
|
|
30
|
+
postcss: postcss,
|
|
31
|
+
less: less,
|
|
32
|
+
htmlPlugin: htmlPlugin,
|
|
33
|
+
devServer: devServer,
|
|
34
|
+
tailwindcss: tailwindcss,
|
|
35
|
+
jest: jest,
|
|
36
|
+
esbuild: esbuild
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { initHtmlConfig, initSourceConfig, initToolsConfig } from "./inits";
|
|
2
|
+
export { transformNormalizedConfig } from "./transformNormalizedConfig";
|
|
3
|
+
export function checkIsLegacyConfig(config) {
|
|
4
|
+
return Boolean(config.legacy);
|
|
5
|
+
}
|
|
6
|
+
export function initialNormalizedConfig(config, appContext) {
|
|
7
|
+
initHtmlConfig(config, appContext);
|
|
8
|
+
initSourceConfig(config, appContext);
|
|
9
|
+
initToolsConfig(config);
|
|
10
|
+
return config;
|
|
11
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
|
+
import path, { dirname, isAbsolute, posix, sep } from 'path';
|
|
5
|
+
import { applyOptionsChain, findExists, findMonorepoRoot, globby, isModernjsMonorepo } from '@modern-js/utils';
|
|
6
|
+
export function initHtmlConfig(config, appContext) {
|
|
7
|
+
var ICON_EXTENSIONS = ['png', 'jpg', 'jpeg', 'svg', 'ico'];
|
|
8
|
+
config.html.appIcon = createBuilderAppIcon(config, appContext);
|
|
9
|
+
config.html.favicon = createBuilderFavicon(config, appContext);
|
|
10
|
+
return config.html;
|
|
11
|
+
function createBuilderAppIcon(config, appContext) {
|
|
12
|
+
var configDir = config.source.configDir;
|
|
13
|
+
var appIcon = findExists(ICON_EXTENSIONS.map(function (ext) {
|
|
14
|
+
return path.resolve(appContext.appDirectory, configDir || './config', "icon.".concat(ext));
|
|
15
|
+
}));
|
|
16
|
+
return typeof appIcon === 'string' ? appIcon : undefined;
|
|
17
|
+
}
|
|
18
|
+
function createBuilderFavicon(config, appContext) {
|
|
19
|
+
var configDir = config.source.configDir;
|
|
20
|
+
var favicon = config.html.favicon;
|
|
21
|
+
var defaultFavicon = findExists(ICON_EXTENSIONS.map(function (ext) {
|
|
22
|
+
return path.resolve(appContext.appDirectory, configDir || './config', "favicon.".concat(ext));
|
|
23
|
+
}));
|
|
24
|
+
return favicon || defaultFavicon || undefined;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function initSourceConfig(config, appContext) {
|
|
28
|
+
config.source.include = createBuilderInclude(config, appContext);
|
|
29
|
+
config.source.moduleScopes = createBuilderModuleScope(config);
|
|
30
|
+
function createBuilderInclude(config, appContext) {
|
|
31
|
+
var include = config.source.include;
|
|
32
|
+
var defaultInclude = [appContext.internalDirectory];
|
|
33
|
+
var transformInclude = (include || []).map(function (include) {
|
|
34
|
+
if (typeof include === 'string') {
|
|
35
|
+
if (isAbsolute(include)) {
|
|
36
|
+
return include;
|
|
37
|
+
}
|
|
38
|
+
return new RegExp(include);
|
|
39
|
+
}
|
|
40
|
+
return include;
|
|
41
|
+
}).concat(defaultInclude); // concat default Include
|
|
42
|
+
|
|
43
|
+
var root = findMonorepoRoot(appContext.appDirectory);
|
|
44
|
+
if (!root) {
|
|
45
|
+
return transformInclude;
|
|
46
|
+
}
|
|
47
|
+
var modernjsMonorepo = isModernjsMonorepo(root);
|
|
48
|
+
if (modernjsMonorepo) {
|
|
49
|
+
var paths = globby.sync(posix.join(root, 'features', '**', 'package.json'), {
|
|
50
|
+
ignore: ['**/node_modules/**/*']
|
|
51
|
+
}).map(function (pathname) {
|
|
52
|
+
return dirname(pathname) + sep;
|
|
53
|
+
});
|
|
54
|
+
return [].concat(_toConsumableArray(paths), _toConsumableArray(transformInclude));
|
|
55
|
+
}
|
|
56
|
+
return transformInclude;
|
|
57
|
+
}
|
|
58
|
+
function createBuilderModuleScope(config) {
|
|
59
|
+
var moduleScopes = config.source.moduleScopes;
|
|
60
|
+
if (moduleScopes) {
|
|
61
|
+
var builderModuleScope = [];
|
|
62
|
+
var DEFAULT_SCOPES = ['./src', './shared', /node_modules/];
|
|
63
|
+
if (Array.isArray(moduleScopes)) {
|
|
64
|
+
if (isPrimitiveScope(moduleScopes)) {
|
|
65
|
+
builderModuleScope = DEFAULT_SCOPES.concat(moduleScopes);
|
|
66
|
+
} else {
|
|
67
|
+
builderModuleScope = [DEFAULT_SCOPES].concat(_toConsumableArray(moduleScopes));
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
builderModuleScope = [DEFAULT_SCOPES, moduleScopes];
|
|
71
|
+
}
|
|
72
|
+
return builderModuleScope;
|
|
73
|
+
} else {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
function isPrimitiveScope(items) {
|
|
77
|
+
return items.every(function (item) {
|
|
78
|
+
return typeof item === 'string' || Object.prototype.toString.call(item) === '[object RegExp]';
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export function initToolsConfig(config) {
|
|
84
|
+
var defaultTsChecker = {
|
|
85
|
+
issue: {
|
|
86
|
+
include: [{
|
|
87
|
+
file: '**/src/**/*'
|
|
88
|
+
}],
|
|
89
|
+
exclude: [{
|
|
90
|
+
file: '**/*.(spec|test).ts'
|
|
91
|
+
}, {
|
|
92
|
+
file: '**/node_modules/**/*'
|
|
93
|
+
}]
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var _config$tools = config.tools,
|
|
97
|
+
tsChecker = _config$tools.tsChecker,
|
|
98
|
+
tsLoader = _config$tools.tsLoader,
|
|
99
|
+
htmlPlugin = _config$tools.htmlPlugin;
|
|
100
|
+
config.tools.tsChecker = applyOptionsChain(defaultTsChecker, tsChecker);
|
|
101
|
+
tsLoader && (config.tools.tsLoader = function (tsLoaderConfig, utils) {
|
|
102
|
+
applyOptionsChain(_objectSpread(_objectSpread({}, tsLoaderConfig), {}, {
|
|
103
|
+
transpileOnly: false,
|
|
104
|
+
allowTsInNodeModules: true
|
|
105
|
+
}), tsLoader || {}, utils);
|
|
106
|
+
});
|
|
107
|
+
config.tools.htmlPlugin = [function (config) {
|
|
108
|
+
return _objectSpread(_objectSpread({}, config), {}, {
|
|
109
|
+
minify: _typeof(config.minify) === 'object' ? _objectSpread(_objectSpread({}, config.minify), {}, {
|
|
110
|
+
removeComments: false
|
|
111
|
+
}) : config.minify
|
|
112
|
+
});
|
|
113
|
+
}].concat(_toConsumableArray(Array.isArray(htmlPlugin) ? htmlPlugin : htmlPlugin ? [htmlPlugin] : []));
|
|
114
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createToolsConfig } from "./createToolsConfig";
|
|
2
|
+
import { createSourceConfig } from "./createSourceConfig";
|
|
3
|
+
import { createOutputConfig } from "./createOutputConfig";
|
|
4
|
+
import { createHtmlConfig } from "./createHtmlConfig";
|
|
5
|
+
export function transformNormalizedConfig(config) {
|
|
6
|
+
var html = createHtmlConfig(config);
|
|
7
|
+
var output = createOutputConfig(config);
|
|
8
|
+
var source = createSourceConfig(config);
|
|
9
|
+
var tools = createToolsConfig(config);
|
|
10
|
+
var bff = config.bff,
|
|
11
|
+
dev = config.dev,
|
|
12
|
+
deploy = config.deploy,
|
|
13
|
+
runtime = config.runtime,
|
|
14
|
+
runtimeByEntries = config.runtimeByEntries,
|
|
15
|
+
server = config.server,
|
|
16
|
+
cliOptions = config.cliOptions,
|
|
17
|
+
plugins = config.plugins,
|
|
18
|
+
testing = config.testing;
|
|
19
|
+
return {
|
|
20
|
+
source: source,
|
|
21
|
+
html: html,
|
|
22
|
+
output: output,
|
|
23
|
+
tools: tools,
|
|
24
|
+
bff: bff,
|
|
25
|
+
dev: dev,
|
|
26
|
+
deploy: deploy,
|
|
27
|
+
runtime: runtime,
|
|
28
|
+
runtimeByEntries: runtimeByEntries,
|
|
29
|
+
server: server,
|
|
30
|
+
cliOptions: cliOptions,
|
|
31
|
+
testing: testing,
|
|
32
|
+
plugins: plugins,
|
|
33
|
+
security: {},
|
|
34
|
+
_raw: {},
|
|
35
|
+
experiments: {},
|
|
36
|
+
performance: {}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
export var defineConfig = function defineConfig(config) {
|
|
3
|
+
return config;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated
|
|
8
|
+
* Using defineConfig first.
|
|
9
|
+
*/
|
|
10
|
+
export var defineLegacyConfig = function defineLegacyConfig(config) {
|
|
11
|
+
return _objectSpread(_objectSpread({}, config), {}, {
|
|
12
|
+
legacy: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import { createAsyncWaterfall, createAsyncWorkflow } from '@modern-js/plugin';
|
|
2
|
-
export var beforeDev = createAsyncWorkflow();
|
|
3
|
-
export var afterDev = createAsyncWorkflow();
|
|
4
|
-
export var beforeCreateCompiler = createAsyncWorkflow();
|
|
5
|
-
export var afterCreateCompiler = createAsyncWorkflow();
|
|
6
|
-
export var beforePrintInstructions = createAsyncWaterfall();
|
|
7
|
-
export var beforeBuild = createAsyncWorkflow();
|
|
8
|
-
export var afterBuild = createAsyncWorkflow();
|
|
9
|
-
export var beforeDeploy = createAsyncWorkflow();
|
|
10
|
-
export var afterDeploy = createAsyncWorkflow();
|
|
1
|
+
import { createAsyncWaterfall, createAsyncWorkflow, createParallelWorkflow } from '@modern-js/plugin';
|
|
11
2
|
export var hooks = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
modifyEntryExport: createAsyncWaterfall(),
|
|
4
|
+
modifyEntryImports: createAsyncWaterfall(),
|
|
5
|
+
modifyEntryRuntimePlugins: createAsyncWaterfall(),
|
|
6
|
+
modifyEntryRenderFunction: createAsyncWaterfall(),
|
|
7
|
+
modifyAsyncEntry: createAsyncWaterfall(),
|
|
8
|
+
modifyFileSystemRoutes: createAsyncWaterfall(),
|
|
9
|
+
modifyServerRoutes: createAsyncWaterfall(),
|
|
10
|
+
htmlPartials: createAsyncWaterfall(),
|
|
11
|
+
beforeGenerateRoutes: createAsyncWaterfall(),
|
|
12
|
+
addDefineTypes: createAsyncWaterfall(),
|
|
13
|
+
beforeDev: createAsyncWorkflow(),
|
|
14
|
+
afterDev: createAsyncWorkflow(),
|
|
15
|
+
beforeCreateCompiler: createAsyncWorkflow(),
|
|
16
|
+
afterCreateCompiler: createAsyncWorkflow(),
|
|
17
|
+
beforePrintInstructions: createAsyncWaterfall(),
|
|
18
|
+
beforeBuild: createAsyncWorkflow(),
|
|
19
|
+
afterBuild: createAsyncWorkflow(),
|
|
20
|
+
beforeDeploy: createAsyncWorkflow(),
|
|
21
|
+
afterDeploy: createAsyncWorkflow(),
|
|
22
|
+
watchFiles: createParallelWorkflow(),
|
|
23
|
+
fileChange: createAsyncWorkflow(),
|
|
24
|
+
beforeRestart: createAsyncWorkflow()
|
|
21
25
|
};
|