prebundle 0.0.1 → 0.0.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/dist/constant.d.ts +0 -12
- package/dist/constant.js +2 -347
- package/dist/helper.d.ts +3 -2
- package/dist/helper.js +32 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -2
- package/package.json +7 -3
- package/bin.js +0 -1
package/dist/constant.d.ts
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
import type { TaskConfig } from './types';
|
|
2
1
|
export declare const ROOT_DIR: string;
|
|
3
2
|
export declare const PACKAGES_DIR: string;
|
|
4
3
|
export declare const DIST_DIR = "compiled";
|
|
5
4
|
export declare const DEFAULT_EXTERNALS: {
|
|
6
|
-
'caniuse-lite': string;
|
|
7
|
-
'/^caniuse-lite(/.*)/': string;
|
|
8
|
-
webpack: string;
|
|
9
|
-
'/^webpack(/.*)/': string;
|
|
10
|
-
lodash: string;
|
|
11
|
-
'/^lodash(/.*)/': string;
|
|
12
|
-
esbuild: string;
|
|
13
5
|
'./package.json': string;
|
|
14
6
|
'../package.json': string;
|
|
15
7
|
'../../package.json': string;
|
|
16
|
-
postcss: string;
|
|
17
|
-
typescript: string;
|
|
18
|
-
'@babel/core': string;
|
|
19
8
|
};
|
|
20
|
-
export declare const TASKS: TaskConfig[];
|
package/dist/constant.js
CHANGED
|
@@ -1,358 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
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;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
const node_path_1 =
|
|
28
|
-
const fs_extra_1 = __importStar(require("fs-extra"));
|
|
29
|
-
const helper_1 = require("./helper");
|
|
3
|
+
exports.DEFAULT_EXTERNALS = exports.DIST_DIR = exports.PACKAGES_DIR = exports.ROOT_DIR = void 0;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
30
5
|
exports.ROOT_DIR = (0, node_path_1.join)(__dirname, '..', '..', '..');
|
|
31
6
|
exports.PACKAGES_DIR = (0, node_path_1.join)(exports.ROOT_DIR, 'packages');
|
|
32
7
|
exports.DIST_DIR = 'compiled';
|
|
33
8
|
exports.DEFAULT_EXTERNALS = {
|
|
34
|
-
// External caniuse-lite data, so users can update it manually.
|
|
35
|
-
'caniuse-lite': 'caniuse-lite',
|
|
36
|
-
'/^caniuse-lite(/.*)/': 'caniuse-lite$1',
|
|
37
|
-
// External webpack, it's hard to bundle.
|
|
38
|
-
webpack: 'webpack',
|
|
39
|
-
'/^webpack(/.*)/': 'webpack$1',
|
|
40
|
-
// External lodash because lots of packages will depend on it.
|
|
41
|
-
lodash: 'lodash',
|
|
42
|
-
'/^lodash(/.*)/': 'lodash$1',
|
|
43
|
-
esbuild: 'esbuild',
|
|
44
9
|
// ncc bundled wrong package.json, using external to avoid this problem
|
|
45
10
|
'./package.json': './package.json',
|
|
46
11
|
'../package.json': './package.json',
|
|
47
12
|
'../../package.json': './package.json',
|
|
48
|
-
postcss: 'postcss',
|
|
49
|
-
typescript: 'typescript',
|
|
50
|
-
'@babel/core': '@babel/core',
|
|
51
|
-
};
|
|
52
|
-
const writeEmptySchemaUtils = (task) => {
|
|
53
|
-
// The package size of `schema-utils` is large, and validate has a performance overhead of tens of ms.
|
|
54
|
-
// So we skip the validation and let TypeScript to ensure type safety.
|
|
55
|
-
const schemaUtilsPath = (0, node_path_1.join)(task.distPath, 'schema-utils.js');
|
|
56
|
-
fs_extra_1.default.outputFileSync(schemaUtilsPath, 'module.exports.validate = () => {};');
|
|
57
13
|
};
|
|
58
|
-
exports.TASKS = [
|
|
59
|
-
{
|
|
60
|
-
packageDir: 'core',
|
|
61
|
-
packageName: '@rsbuild/core',
|
|
62
|
-
dependencies: [
|
|
63
|
-
'open',
|
|
64
|
-
'commander',
|
|
65
|
-
'dotenv',
|
|
66
|
-
'dotenv-expand',
|
|
67
|
-
'ws',
|
|
68
|
-
'on-finished',
|
|
69
|
-
{
|
|
70
|
-
name: 'launch-editor-middleware',
|
|
71
|
-
ignoreDts: true,
|
|
72
|
-
externals: {
|
|
73
|
-
picocolors: '@rsbuild/shared/picocolors',
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'sirv',
|
|
78
|
-
afterBundle(task) {
|
|
79
|
-
(0, helper_1.replaceFileContent)((0, node_path_1.join)(task.distPath, 'sirv.d.ts'), (content) => `${content.replace("declare module 'sirv'", 'declare namespace sirv')}\nexport = sirv;`);
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: 'http-compression',
|
|
84
|
-
ignoreDts: true,
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
name: 'connect-history-api-fallback',
|
|
88
|
-
ignoreDts: true,
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
packageDir: 'shared',
|
|
94
|
-
packageName: '@rsbuild/shared',
|
|
95
|
-
dependencies: [
|
|
96
|
-
'jiti',
|
|
97
|
-
'rslog',
|
|
98
|
-
'deepmerge',
|
|
99
|
-
'fs-extra',
|
|
100
|
-
'chokidar',
|
|
101
|
-
'webpack-merge',
|
|
102
|
-
'mime-types',
|
|
103
|
-
'connect',
|
|
104
|
-
'browserslist',
|
|
105
|
-
'gzip-size',
|
|
106
|
-
'json5',
|
|
107
|
-
{
|
|
108
|
-
name: 'webpack-chain',
|
|
109
|
-
externals: {
|
|
110
|
-
deepmerge: '../deepmerge',
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
name: 'yaml',
|
|
115
|
-
ignoreDts: true,
|
|
116
|
-
afterBundle(task) {
|
|
117
|
-
fs_extra_1.default.writeFileSync((0, node_path_1.join)(task.distPath, 'index.d.ts'), 'export declare function parse(src: string, options?: any): any;');
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
name: 'line-diff',
|
|
122
|
-
ignoreDts: true,
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
name: 'semver',
|
|
126
|
-
ignoreDts: true,
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
name: 'icss-utils',
|
|
130
|
-
ignoreDts: true,
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
name: 'postcss-value-parser',
|
|
134
|
-
ignoreDts: true,
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
name: 'postcss-modules-local-by-default',
|
|
138
|
-
ignoreDts: true,
|
|
139
|
-
externals: {
|
|
140
|
-
'icss-utils': '../icss-utils',
|
|
141
|
-
'postcss-value-parser': '../postcss-value-parser',
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
name: 'postcss-modules-extract-imports',
|
|
146
|
-
ignoreDts: true,
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
name: 'postcss-modules-scope',
|
|
150
|
-
ignoreDts: true,
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
name: 'postcss-modules-values',
|
|
154
|
-
ignoreDts: true,
|
|
155
|
-
externals: {
|
|
156
|
-
'icss-utils': '../icss-utils',
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
name: 'sass-loader',
|
|
161
|
-
externals: {
|
|
162
|
-
sass: '../sass',
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
name: 'sass',
|
|
167
|
-
externals: {
|
|
168
|
-
chokidar: '../chokidar',
|
|
169
|
-
},
|
|
170
|
-
afterBundle(task) {
|
|
171
|
-
(0, fs_extra_1.copySync)((0, node_path_1.join)(task.depPath, 'types'), (0, node_path_1.join)(task.distPath, 'types'));
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
name: 'style-loader',
|
|
176
|
-
ignoreDts: true,
|
|
177
|
-
afterBundle: (task) => {
|
|
178
|
-
fs_extra_1.default.copySync((0, node_path_1.join)(task.depPath, 'dist/runtime'), (0, node_path_1.join)(task.distPath, 'runtime'));
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
name: 'less',
|
|
183
|
-
externals: {
|
|
184
|
-
// needle is an optional dependency and no need to bundle it.
|
|
185
|
-
needle: 'needle',
|
|
186
|
-
},
|
|
187
|
-
afterBundle(task) {
|
|
188
|
-
(0, helper_1.replaceFileContent)((0, node_path_1.join)(task.distPath, 'index.d.ts'), (content) => content.replace(`declare module "less" {\n export = less;\n}`, 'export = Less;'));
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
name: 'less-loader',
|
|
193
|
-
ignoreDts: true,
|
|
194
|
-
externals: {
|
|
195
|
-
less: '../less',
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
name: 'css-loader',
|
|
200
|
-
ignoreDts: true,
|
|
201
|
-
externals: {
|
|
202
|
-
semver: '../semver',
|
|
203
|
-
'postcss-value-parser': '../postcss-value-parser',
|
|
204
|
-
'postcss-modules-local-by-default': '../postcss-modules-local-by-default',
|
|
205
|
-
'postcss-modules-extract-imports': '../postcss-modules-extract-imports',
|
|
206
|
-
'postcss-modules-scope': '../postcss-modules-scope',
|
|
207
|
-
'postcss-modules-values': '../postcss-modules-values',
|
|
208
|
-
'icss-utils': '../icss-utils',
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
name: 'postcss-loader',
|
|
213
|
-
externals: {
|
|
214
|
-
jiti: '../jiti',
|
|
215
|
-
semver: '../semver',
|
|
216
|
-
},
|
|
217
|
-
ignoreDts: true,
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
name: 'postcss-load-config',
|
|
221
|
-
externals: {
|
|
222
|
-
jiti: '../jiti',
|
|
223
|
-
yaml: '../yaml',
|
|
224
|
-
},
|
|
225
|
-
ignoreDts: true,
|
|
226
|
-
// this is a trick to avoid ncc compiling the dynamic import syntax
|
|
227
|
-
// https://github.com/vercel/ncc/issues/935
|
|
228
|
-
beforeBundle(task) {
|
|
229
|
-
(0, helper_1.replaceFileContent)((0, node_path_1.join)(task.depPath, 'src/req.js'), (content) => `${content.replace('await import', 'await __import')}`);
|
|
230
|
-
},
|
|
231
|
-
afterBundle(task) {
|
|
232
|
-
(0, helper_1.replaceFileContent)((0, node_path_1.join)(task.distPath, 'index.js'), (content) => `${content.replace('await __import', 'await import')}`);
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
name: 'loader-utils2',
|
|
237
|
-
ignoreDts: true,
|
|
238
|
-
externals: {
|
|
239
|
-
json5: '../json5',
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
name: 'picocolors',
|
|
244
|
-
beforeBundle({ depPath }) {
|
|
245
|
-
const typesFile = node_path_1.default.join(depPath, 'types.ts');
|
|
246
|
-
// Fix type bundle
|
|
247
|
-
if (fs_extra_1.default.existsSync(typesFile)) {
|
|
248
|
-
fs_extra_1.default.renameSync(typesFile, node_path_1.default.join(depPath, 'types.d.ts'));
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
name: 'resolve-url-loader',
|
|
254
|
-
ignoreDts: true,
|
|
255
|
-
externals: {
|
|
256
|
-
'loader-utils': '../loader-utils2',
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
name: 'webpack-dev-middleware',
|
|
261
|
-
externals: {
|
|
262
|
-
'schema-utils': './schema-utils',
|
|
263
|
-
'schema-utils/declarations/validate': 'schema-utils/declarations/validate',
|
|
264
|
-
'mime-types': '../mime-types',
|
|
265
|
-
},
|
|
266
|
-
afterBundle: writeEmptySchemaUtils,
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
name: 'autoprefixer',
|
|
270
|
-
externals: {
|
|
271
|
-
picocolors: '../picocolors',
|
|
272
|
-
browserslist: '../browserslist',
|
|
273
|
-
'postcss-value-parser': '../postcss-value-parser',
|
|
274
|
-
},
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
name: 'http-proxy-middleware',
|
|
278
|
-
externals: {
|
|
279
|
-
// express is a peer dependency, no need to provide express type
|
|
280
|
-
express: 'express',
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
// The webpack-bundle-analyzer version was locked to v4.9.0 to be compatible with Rspack
|
|
285
|
-
// If we need to upgrade the version, please check if the chunk detail can be displayed correctly
|
|
286
|
-
name: 'webpack-bundle-analyzer',
|
|
287
|
-
externals: {
|
|
288
|
-
'gzip-size': '../gzip-size',
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
],
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
packageDir: 'plugin-babel',
|
|
295
|
-
packageName: '@rsbuild/plugin-babel',
|
|
296
|
-
dependencies: [
|
|
297
|
-
{
|
|
298
|
-
name: 'babel-loader',
|
|
299
|
-
ignoreDts: true,
|
|
300
|
-
externals: {
|
|
301
|
-
'schema-utils': './schema-utils',
|
|
302
|
-
},
|
|
303
|
-
afterBundle: writeEmptySchemaUtils,
|
|
304
|
-
},
|
|
305
|
-
],
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
packageDir: 'plugin-svgr',
|
|
309
|
-
packageName: '@rsbuild/plugin-svgr',
|
|
310
|
-
dependencies: [
|
|
311
|
-
{
|
|
312
|
-
name: 'file-loader',
|
|
313
|
-
ignoreDts: true,
|
|
314
|
-
externals: {
|
|
315
|
-
'schema-utils': './schema-utils',
|
|
316
|
-
'loader-utils': '@rsbuild/shared/loader-utils2',
|
|
317
|
-
},
|
|
318
|
-
afterBundle: writeEmptySchemaUtils,
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
name: 'url-loader',
|
|
322
|
-
ignoreDts: true,
|
|
323
|
-
externals: {
|
|
324
|
-
'schema-utils': './schema-utils',
|
|
325
|
-
'loader-utils': '@rsbuild/shared/loader-utils2',
|
|
326
|
-
'mime-types': '@rsbuild/shared/mime-types',
|
|
327
|
-
},
|
|
328
|
-
afterBundle(task) {
|
|
329
|
-
writeEmptySchemaUtils(task);
|
|
330
|
-
(0, helper_1.replaceFileContent)((0, node_path_1.join)(task.distPath, 'index.js'), (content) => {
|
|
331
|
-
// use prebundle file-loader
|
|
332
|
-
return content.replace('"file-loader"', 'require.resolve("../file-loader")');
|
|
333
|
-
});
|
|
334
|
-
},
|
|
335
|
-
},
|
|
336
|
-
],
|
|
337
|
-
},
|
|
338
|
-
{
|
|
339
|
-
packageDir: 'plugin-yaml',
|
|
340
|
-
packageName: '@rsbuild/plugin-yaml',
|
|
341
|
-
dependencies: [
|
|
342
|
-
{
|
|
343
|
-
name: 'yaml-loader',
|
|
344
|
-
ignoreDts: true,
|
|
345
|
-
},
|
|
346
|
-
],
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
packageDir: 'plugin-rem',
|
|
350
|
-
packageName: '@rsbuild/plugin-rem',
|
|
351
|
-
dependencies: [
|
|
352
|
-
{
|
|
353
|
-
name: 'postcss-pxtorem',
|
|
354
|
-
ignoreDts: true,
|
|
355
|
-
},
|
|
356
|
-
],
|
|
357
|
-
},
|
|
358
|
-
];
|
package/dist/helper.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ParsedTask } from './types';
|
|
1
|
+
import type { ParsedTask, TaskConfig } from './types';
|
|
2
2
|
export declare function findDepPath(name: string): string;
|
|
3
|
-
export declare
|
|
3
|
+
export declare const resolveConfig: () => Promise<any>;
|
|
4
|
+
export declare function parseTasks(tasks: TaskConfig[]): ParsedTask[];
|
|
4
5
|
export declare function pick<T, U extends keyof T>(obj: T, keys: ReadonlyArray<U>): Pick<T, U>;
|
|
5
6
|
export declare function replaceFileContent(filePath: string, replaceFn: (content: string) => string): void;
|
package/dist/helper.js
CHANGED
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
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;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.replaceFileContent = exports.pick = exports.parseTasks = exports.findDepPath = void 0;
|
|
29
|
+
exports.replaceFileContent = exports.pick = exports.parseTasks = exports.resolveConfig = exports.findDepPath = void 0;
|
|
7
30
|
const node_path_1 = require("node:path");
|
|
8
31
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
32
|
const constant_1 = require("./constant");
|
|
@@ -18,9 +41,15 @@ function findDepPath(name) {
|
|
|
18
41
|
return entry;
|
|
19
42
|
}
|
|
20
43
|
exports.findDepPath = findDepPath;
|
|
21
|
-
|
|
44
|
+
const resolveConfig = async () => {
|
|
45
|
+
const configPath = (0, node_path_1.join)(__dirname, 'prebundle.config.mjs');
|
|
46
|
+
const config = await Promise.resolve(`${configPath}`).then(s => __importStar(require(s)));
|
|
47
|
+
return config.default;
|
|
48
|
+
};
|
|
49
|
+
exports.resolveConfig = resolveConfig;
|
|
50
|
+
function parseTasks(tasks) {
|
|
22
51
|
const result = [];
|
|
23
|
-
for (const { packageName, packageDir, dependencies } of
|
|
52
|
+
for (const { packageName, packageDir, dependencies } of tasks) {
|
|
24
53
|
for (const dep of dependencies) {
|
|
25
54
|
const depName = typeof dep === 'string' ? dep : dep.name;
|
|
26
55
|
const importPath = (0, node_path_1.join)(packageName, constant_1.DIST_DIR, depName);
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function run(): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.run = void 0;
|
|
3
4
|
const helper_1 = require("./helper");
|
|
4
5
|
const prebundle_1 = require("./prebundle");
|
|
5
6
|
async function run() {
|
|
6
|
-
const
|
|
7
|
+
const config = await (0, helper_1.resolveConfig)();
|
|
8
|
+
const parsedTasks = (0, helper_1.parseTasks)(config.tasks);
|
|
7
9
|
for (const task of parsedTasks) {
|
|
8
10
|
await (0, prebundle_1.prebundle)(task);
|
|
9
11
|
}
|
|
10
12
|
}
|
|
11
|
-
run
|
|
13
|
+
exports.run = run;
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prebundle",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
|
+
"type": "commonjs",
|
|
5
6
|
"files": [
|
|
6
7
|
"dist"
|
|
7
8
|
],
|
|
@@ -17,11 +18,14 @@
|
|
|
17
18
|
"devDependencies": {
|
|
18
19
|
"@types/fs-extra": "^11.0.4",
|
|
19
20
|
"@types/node": "18.x",
|
|
21
|
+
"prettier": "^3.2.5",
|
|
20
22
|
"typescript": "^5.4.2"
|
|
21
23
|
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"registry": "https://registry.npmjs.org/"
|
|
26
|
+
},
|
|
22
27
|
"scripts": {
|
|
23
28
|
"dev": "tsc --watch",
|
|
24
|
-
"build": "tsc"
|
|
25
|
-
"start": "pnpm build && node ./dist/index.js"
|
|
29
|
+
"build": "tsc"
|
|
26
30
|
}
|
|
27
31
|
}
|
package/bin.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|