@modern-js/builder 2.26.0 → 2.27.0
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 +19 -0
- package/dist/createBuilder.d.ts +1 -1
- package/dist/createBuilder.js +48 -38
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -8
- package/dist/plugins/antd.d.ts +1 -1
- package/dist/plugins/antd.js +52 -30
- package/dist/plugins/arco.d.ts +1 -1
- package/dist/plugins/arco.js +43 -35
- package/dist/plugins/asset.d.ts +1 -1
- package/dist/plugins/asset.js +29 -25
- package/dist/plugins/assetsRetry.d.ts +1 -1
- package/dist/plugins/assetsRetry.js +34 -51
- package/dist/plugins/bundleAnalyzer.d.ts +1 -1
- package/dist/plugins/bundleAnalyzer.js +29 -50
- package/dist/plugins/cache.d.ts +1 -1
- package/dist/plugins/cache.js +68 -87
- package/dist/plugins/checkSyntax.d.ts +1 -1
- package/dist/plugins/checkSyntax.js +40 -54
- package/dist/plugins/cleanOutput.d.ts +1 -1
- package/dist/plugins/cleanOutput.js +22 -38
- package/dist/plugins/devtool.d.ts +1 -1
- package/dist/plugins/devtool.js +23 -21
- package/dist/plugins/entry.d.ts +1 -1
- package/dist/plugins/entry.js +23 -19
- package/dist/plugins/externals.d.ts +1 -1
- package/dist/plugins/externals.js +28 -25
- package/dist/plugins/fileSize.d.ts +1 -1
- package/dist/plugins/fileSize.js +124 -130
- package/dist/plugins/html.d.ts +1 -1
- package/dist/plugins/html.js +203 -206
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +40 -53
- package/dist/plugins/inlineChunk.d.ts +1 -1
- package/dist/plugins/inlineChunk.js +50 -59
- package/dist/plugins/moment.d.ts +1 -1
- package/dist/plugins/moment.js +23 -20
- package/dist/plugins/rem.d.ts +1 -1
- package/dist/plugins/rem.js +74 -97
- package/dist/plugins/sourceBuild.d.ts +12 -12
- package/dist/plugins/sourceBuild.js +125 -109
- package/dist/plugins/splitChunks.d.ts +1 -1
- package/dist/plugins/splitChunks.js +206 -229
- package/dist/plugins/startUrl.d.ts +1 -1
- package/dist/plugins/startUrl.js +62 -78
- package/dist/plugins/svg.d.ts +1 -1
- package/dist/plugins/svg.js +64 -81
- package/dist/plugins/target.d.ts +1 -1
- package/dist/plugins/target.js +52 -31
- package/dist/plugins/toml.d.ts +1 -1
- package/dist/plugins/toml.js +16 -15
- package/dist/plugins/tsChecker.d.ts +1 -1
- package/dist/plugins/tsChecker.js +69 -92
- package/dist/plugins/wasm.d.ts +1 -1
- package/dist/plugins/wasm.js +31 -32
- package/dist/plugins/yaml.d.ts +1 -1
- package/dist/plugins/yaml.js +16 -15
- package/package.json +11 -9
package/dist/plugins/html.js
CHANGED
|
@@ -1,221 +1,218 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
17
4
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
applyInjectTags: function() {
|
|
14
|
+
return applyInjectTags;
|
|
15
|
+
},
|
|
16
|
+
builderPluginHtml: function() {
|
|
17
|
+
return builderPluginHtml;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
21
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
22
|
+
const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
|
|
23
|
+
const _buildershared = require("@modern-js/builder-shared");
|
|
24
|
+
const _lodash = /* @__PURE__ */ _interop_require_default._(require("@modern-js/utils/lodash"));
|
|
33
25
|
async function getTemplateParameters(entryName, config, assetPrefix) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
return applyOptionsChain(defaultOptions, templateParams);
|
|
26
|
+
const { applyOptionsChain } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/utils")));
|
|
27
|
+
const { mountId, templateParameters, templateParametersByEntries } = config.html;
|
|
28
|
+
const meta = await (0, _buildershared.getMetaTags)(entryName, config);
|
|
29
|
+
const title = (0, _buildershared.getTitle)(entryName, config);
|
|
30
|
+
const templateParams = (templateParametersByEntries === null || templateParametersByEntries === void 0 ? void 0 : templateParametersByEntries[entryName]) || templateParameters;
|
|
31
|
+
const baseParameters = {
|
|
32
|
+
meta,
|
|
33
|
+
title,
|
|
34
|
+
mountId,
|
|
35
|
+
entryName,
|
|
36
|
+
assetPrefix
|
|
37
|
+
};
|
|
38
|
+
return (compilation, assets, assetTags, pluginOptions) => {
|
|
39
|
+
const defaultOptions = {
|
|
40
|
+
compilation,
|
|
41
|
+
webpackConfig: compilation.options,
|
|
42
|
+
htmlWebpackPlugin: {
|
|
43
|
+
tags: assetTags,
|
|
44
|
+
files: assets,
|
|
45
|
+
options: pluginOptions
|
|
46
|
+
},
|
|
47
|
+
...baseParameters
|
|
58
48
|
};
|
|
49
|
+
return applyOptionsChain(defaultOptions, templateParams);
|
|
50
|
+
};
|
|
59
51
|
}
|
|
60
52
|
async function getChunks(entryName, entryValue) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
const { isPlainObject } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/utils")));
|
|
54
|
+
const dependOn = [];
|
|
55
|
+
if (isPlainObject(entryValue)) {
|
|
56
|
+
dependOn.push(...entryValue.dependOn);
|
|
57
|
+
}
|
|
58
|
+
return [
|
|
59
|
+
...dependOn,
|
|
60
|
+
entryName
|
|
61
|
+
];
|
|
68
62
|
}
|
|
69
63
|
const applyInjectTags = (api) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
});
|
|
64
|
+
api.modifyBundlerChain(async (chain, { HtmlPlugin, CHAIN_ID }) => {
|
|
65
|
+
const config = api.getNormalizedConfig();
|
|
66
|
+
const tags = _lodash.default.castArray(config.html.tags).filter(Boolean);
|
|
67
|
+
const tagsByEntries = _lodash.default.mapValues(config.html.tagsByEntries, (tags2) => _lodash.default.castArray(tags2).filter(Boolean));
|
|
68
|
+
const shouldByEntries = _lodash.default.some(tagsByEntries, "length");
|
|
69
|
+
if (!tags.length && !shouldByEntries) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const { HtmlTagsPlugin } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/builder-shared")));
|
|
73
|
+
const sharedOptions = {
|
|
74
|
+
HtmlPlugin,
|
|
75
|
+
append: true,
|
|
76
|
+
hash: false,
|
|
77
|
+
publicPath: true,
|
|
78
|
+
tags
|
|
79
|
+
};
|
|
80
|
+
if (tags.length && !shouldByEntries) {
|
|
81
|
+
chain.plugin(CHAIN_ID.PLUGIN.HTML_TAGS).use(HtmlTagsPlugin, [
|
|
82
|
+
sharedOptions
|
|
83
|
+
]);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
for (const [entry, filename] of Object.entries(api.getHTMLPaths())) {
|
|
87
|
+
const opts = {
|
|
88
|
+
...sharedOptions,
|
|
89
|
+
includes: [
|
|
90
|
+
filename
|
|
91
|
+
]
|
|
92
|
+
};
|
|
93
|
+
entry in tagsByEntries && (opts.tags = tagsByEntries[entry]);
|
|
94
|
+
chain.plugin(`${CHAIN_ID.PLUGIN.HTML_TAGS}#${entry}`).use(HtmlTagsPlugin, [
|
|
95
|
+
opts
|
|
96
|
+
]);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
106
99
|
};
|
|
107
|
-
exports.applyInjectTags = applyInjectTags;
|
|
108
100
|
const builderPluginHtml = () => ({
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
101
|
+
name: "builder-plugin-html",
|
|
102
|
+
setup(api) {
|
|
103
|
+
const routesInfo = [];
|
|
104
|
+
api.modifyBundlerChain(async (chain, { HtmlPlugin, isProd, CHAIN_ID, target }) => {
|
|
105
|
+
const config = api.getNormalizedConfig();
|
|
106
|
+
if ((0, _buildershared.isHtmlDisabled)(config, target)) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const { removeTailSlash, applyOptionsChain } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/utils")));
|
|
110
|
+
const minify = (0, _buildershared.getMinify)(isProd, config);
|
|
111
|
+
const assetPrefix = removeTailSlash(chain.output.get("publicPath") || "");
|
|
112
|
+
const entries = chain.entryPoints.entries() || {};
|
|
113
|
+
const entryNames = Object.keys(entries);
|
|
114
|
+
const htmlPaths = api.getHTMLPaths();
|
|
115
|
+
const faviconUrls = [];
|
|
116
|
+
await Promise.all(entryNames.map(async (entryName, index) => {
|
|
117
|
+
const entryValue = entries[entryName].values();
|
|
118
|
+
const chunks = await getChunks(entryName, entryValue);
|
|
119
|
+
const inject = (0, _buildershared.getInject)(entryName, config);
|
|
120
|
+
const favicon = (0, _buildershared.getFavicon)(entryName, config);
|
|
121
|
+
const filename = htmlPaths[entryName];
|
|
122
|
+
const template = (0, _buildershared.getTemplatePath)(entryName, config);
|
|
123
|
+
const templateParameters = await getTemplateParameters(entryName, config, assetPrefix);
|
|
124
|
+
const pluginOptions = {
|
|
125
|
+
chunks,
|
|
126
|
+
inject,
|
|
127
|
+
minify,
|
|
128
|
+
filename,
|
|
129
|
+
template,
|
|
130
|
+
templateParameters,
|
|
131
|
+
scriptLoading: config.html.scriptLoading
|
|
132
|
+
};
|
|
133
|
+
if (favicon) {
|
|
134
|
+
if ((0, _buildershared.isURL)(favicon)) {
|
|
135
|
+
faviconUrls.push({
|
|
136
|
+
filename,
|
|
137
|
+
url: favicon
|
|
138
|
+
});
|
|
139
|
+
} else {
|
|
140
|
+
pluginOptions.favicon = favicon;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const finalOptions = applyOptionsChain(pluginOptions, config.tools.htmlPlugin, {
|
|
144
|
+
entryName,
|
|
145
|
+
entryValue
|
|
146
|
+
});
|
|
147
|
+
routesInfo.push({
|
|
148
|
+
urlPath: index === 0 ? "/" : `/${entryName}`,
|
|
149
|
+
entryName,
|
|
150
|
+
entryPath: filename,
|
|
151
|
+
isSPA: true
|
|
152
|
+
});
|
|
153
|
+
chain.plugin(`${CHAIN_ID.PLUGIN.HTML}-${entryName}`).use(HtmlPlugin, [
|
|
154
|
+
finalOptions
|
|
155
|
+
]);
|
|
156
|
+
}));
|
|
157
|
+
if (config.security) {
|
|
158
|
+
const { nonce } = config.security;
|
|
159
|
+
if (nonce) {
|
|
160
|
+
const { HtmlNoncePlugin } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/builder-shared")));
|
|
161
|
+
chain.plugin(CHAIN_ID.PLUGIN.HTML_NONCE).use(HtmlNoncePlugin, [
|
|
162
|
+
{
|
|
163
|
+
nonce,
|
|
164
|
+
HtmlPlugin
|
|
117
165
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const filename = htmlPaths[entryName];
|
|
131
|
-
const template = (0, builder_shared_1.getTemplatePath)(entryName, config);
|
|
132
|
-
const templateParameters = await getTemplateParameters(entryName, config, assetPrefix);
|
|
133
|
-
const pluginOptions = {
|
|
134
|
-
chunks,
|
|
135
|
-
inject,
|
|
136
|
-
minify,
|
|
137
|
-
filename,
|
|
138
|
-
template,
|
|
139
|
-
templateParameters,
|
|
140
|
-
scriptLoading: config.html.scriptLoading,
|
|
141
|
-
};
|
|
142
|
-
if (favicon) {
|
|
143
|
-
if ((0, builder_shared_1.isURL)(favicon)) {
|
|
144
|
-
faviconUrls.push({
|
|
145
|
-
filename,
|
|
146
|
-
url: favicon,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
// HTMLWebpackPlugin only support favicon file path
|
|
151
|
-
pluginOptions.favicon = favicon;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
const finalOptions = applyOptionsChain(pluginOptions, config.tools.htmlPlugin, {
|
|
155
|
-
entryName,
|
|
156
|
-
entryValue,
|
|
157
|
-
});
|
|
158
|
-
routesInfo.push({
|
|
159
|
-
urlPath: index === 0 ? '/' : `/${entryName}`,
|
|
160
|
-
entryName,
|
|
161
|
-
entryPath: filename,
|
|
162
|
-
isSPA: true,
|
|
163
|
-
});
|
|
164
|
-
chain
|
|
165
|
-
.plugin(`${CHAIN_ID.PLUGIN.HTML}-${entryName}`)
|
|
166
|
-
.use(HtmlPlugin, [finalOptions]);
|
|
167
|
-
}));
|
|
168
|
-
if (config.security) {
|
|
169
|
-
const { nonce } = config.security;
|
|
170
|
-
if (nonce) {
|
|
171
|
-
const { HtmlNoncePlugin } = await Promise.resolve().then(() => __importStar(require('@modern-js/builder-shared')));
|
|
172
|
-
chain
|
|
173
|
-
.plugin(CHAIN_ID.PLUGIN.HTML_NONCE)
|
|
174
|
-
.use(HtmlNoncePlugin, [{ nonce, HtmlPlugin }]);
|
|
175
|
-
}
|
|
166
|
+
]);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (config.html) {
|
|
170
|
+
const { appIcon, crossorigin } = config.html;
|
|
171
|
+
if (crossorigin) {
|
|
172
|
+
const { HtmlCrossOriginPlugin } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/builder-shared")));
|
|
173
|
+
const formattedCrossorigin = crossorigin === true ? "anonymous" : crossorigin;
|
|
174
|
+
chain.plugin(CHAIN_ID.PLUGIN.HTML_CROSS_ORIGIN).use(HtmlCrossOriginPlugin, [
|
|
175
|
+
{
|
|
176
|
+
crossOrigin: formattedCrossorigin,
|
|
177
|
+
HtmlPlugin
|
|
176
178
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
]);
|
|
187
|
-
chain.output.crossOriginLoading(formattedCrossorigin);
|
|
188
|
-
}
|
|
189
|
-
if (faviconUrls.length) {
|
|
190
|
-
const { HtmlFaviconUrlPlugin } = await Promise.resolve().then(() => __importStar(require('@modern-js/builder-shared')));
|
|
191
|
-
chain
|
|
192
|
-
.plugin(CHAIN_ID.PLUGIN.FAVICON_URL)
|
|
193
|
-
.use(HtmlFaviconUrlPlugin, [{ faviconUrls, HtmlPlugin }]);
|
|
194
|
-
}
|
|
195
|
-
if (appIcon) {
|
|
196
|
-
const { HtmlAppIconPlugin } = await Promise.resolve().then(() => __importStar(require('@modern-js/builder-shared')));
|
|
197
|
-
const distDir = (0, builder_shared_1.getDistPath)(config.output, 'image');
|
|
198
|
-
const iconPath = path_1.default.isAbsolute(appIcon)
|
|
199
|
-
? appIcon
|
|
200
|
-
: path_1.default.join(api.context.rootPath, appIcon);
|
|
201
|
-
chain
|
|
202
|
-
.plugin(CHAIN_ID.PLUGIN.APP_ICON)
|
|
203
|
-
.use(HtmlAppIconPlugin, [{ iconPath, distDir, HtmlPlugin }]);
|
|
204
|
-
}
|
|
179
|
+
]);
|
|
180
|
+
chain.output.crossOriginLoading(formattedCrossorigin);
|
|
181
|
+
}
|
|
182
|
+
if (faviconUrls.length) {
|
|
183
|
+
const { HtmlFaviconUrlPlugin } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/builder-shared")));
|
|
184
|
+
chain.plugin(CHAIN_ID.PLUGIN.FAVICON_URL).use(HtmlFaviconUrlPlugin, [
|
|
185
|
+
{
|
|
186
|
+
faviconUrls,
|
|
187
|
+
HtmlPlugin
|
|
205
188
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
189
|
+
]);
|
|
190
|
+
}
|
|
191
|
+
if (appIcon) {
|
|
192
|
+
const { HtmlAppIconPlugin } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/builder-shared")));
|
|
193
|
+
const distDir = (0, _buildershared.getDistPath)(config.output, "image");
|
|
194
|
+
const iconPath = _path.default.isAbsolute(appIcon) ? appIcon : _path.default.join(api.context.rootPath, appIcon);
|
|
195
|
+
chain.plugin(CHAIN_ID.PLUGIN.APP_ICON).use(HtmlAppIconPlugin, [
|
|
196
|
+
{
|
|
197
|
+
iconPath,
|
|
198
|
+
distDir,
|
|
199
|
+
HtmlPlugin
|
|
214
200
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
201
|
+
]);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
const emitRouteJson = async () => {
|
|
206
|
+
const { fs, ROUTE_SPEC_FILE } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/utils")));
|
|
207
|
+
const routeFilePath = _path.default.join(api.context.distPath, ROUTE_SPEC_FILE);
|
|
208
|
+
if (!await (0, _buildershared.isFileExists)(routeFilePath) && routesInfo.length) {
|
|
209
|
+
await fs.outputFile(routeFilePath, JSON.stringify({
|
|
210
|
+
routes: routesInfo
|
|
211
|
+
}, null, 2));
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
api.onBeforeBuild(emitRouteJson);
|
|
215
|
+
api.onBeforeStartDevServer(emitRouteJson);
|
|
216
|
+
applyInjectTags(api);
|
|
217
|
+
}
|
|
220
218
|
});
|
|
221
|
-
exports.builderPluginHtml = builderPluginHtml;
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Plugins } from '@modern-js/builder-shared';
|
|
2
|
-
export declare const plugins: Plugins;
|
|
2
|
+
export declare const plugins: Plugins;
|
package/dist/plugins/index.js
CHANGED
|
@@ -1,56 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
17
4
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
5
|
+
Object.defineProperty(exports, "plugins", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return plugins;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _buildershared = require("@modern-js/builder-shared");
|
|
13
|
+
const plugins = {
|
|
14
|
+
html: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./html"))).then((m) => m.builderPluginHtml()),
|
|
15
|
+
cleanOutput: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./cleanOutput"))).then((m) => m.builderPluginCleanOutput()),
|
|
16
|
+
startUrl: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./startUrl"))).then((m) => m.builderPluginStartUrl()),
|
|
17
|
+
fileSize: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./fileSize"))).then((m) => m.builderPluginFileSize()),
|
|
18
|
+
devtool: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./devtool"))).then((m) => m.builderPluginDevtool()),
|
|
19
|
+
target: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./target"))).then((m) => m.builderPluginTarget()),
|
|
20
|
+
entry: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./entry"))).then((m) => m.builderPluginEntry()),
|
|
21
|
+
cache: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./cache"))).then((m) => m.builderPluginCache()),
|
|
22
|
+
yaml: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./yaml"))).then((m) => m.builderPluginYaml()),
|
|
23
|
+
toml: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./toml"))).then((m) => m.builderPluginToml()),
|
|
24
|
+
svg: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./svg"))).then((m) => m.builderPluginSvg()),
|
|
25
|
+
splitChunks: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./splitChunks"))).then((m) => m.builderPluginSplitChunks()),
|
|
26
|
+
inlineChunk: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./inlineChunk"))).then((m) => m.builderPluginInlineChunk()),
|
|
27
|
+
bundleAnalyzer: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./bundleAnalyzer"))).then((m) => m.builderPluginBundleAnalyzer()),
|
|
28
|
+
font: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./asset"))).then((m) => m.builderAssetPlugin("font", _buildershared.FONT_EXTENSIONS)),
|
|
29
|
+
image: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./asset"))).then((m) => m.builderAssetPlugin("image", _buildershared.IMAGE_EXTENSIONS)),
|
|
30
|
+
media: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./asset"))).then((m) => m.builderAssetPlugin("media", _buildershared.MEDIA_EXTENSIONS)),
|
|
31
|
+
assetsRetry: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./assetsRetry"))).then((m) => m.builderPluginAssetsRetry()),
|
|
32
|
+
antd: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./antd"))).then((m) => m.builderPluginAntd()),
|
|
33
|
+
arco: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./arco"))).then((m) => m.builderPluginArco()),
|
|
34
|
+
tsChecker: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./tsChecker"))).then((m) => m.builderPluginTsChecker()),
|
|
35
|
+
checkSyntax: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./checkSyntax"))).then((m) => m.builderPluginCheckSyntax()),
|
|
36
|
+
rem: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./rem"))).then((m) => m.builderPluginRem()),
|
|
37
|
+
wasm: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./wasm"))).then((m) => m.builderPluginWasm()),
|
|
38
|
+
moment: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./moment"))).then((m) => m.builderPluginMoment()),
|
|
39
|
+
externals: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./externals"))).then((m) => m.builderPluginExternals()),
|
|
40
|
+
sourceBuild: () => Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./sourceBuild"))).then((m) => m.builderPluginSourceBuild({
|
|
41
|
+
sourceField: "source"
|
|
42
|
+
}))
|
|
56
43
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DefaultBuilderPlugin } from '@modern-js/builder-shared';
|
|
2
|
-
export declare const builderPluginInlineChunk: () => DefaultBuilderPlugin;
|
|
2
|
+
export declare const builderPluginInlineChunk: () => DefaultBuilderPlugin;
|