weapp-vite 1.3.3 → 1.3.4
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/{chunk-EA52OCYF.mjs → chunk-S7BZPKXE.mjs} +13 -16
- package/dist/cli.cjs +13 -16
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +12 -15
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
|
@@ -3,7 +3,7 @@ import logger from "@weapp-core/logger";
|
|
|
3
3
|
var logger_default = logger;
|
|
4
4
|
|
|
5
5
|
// package.json
|
|
6
|
-
var version = "1.3.
|
|
6
|
+
var version = "1.3.4";
|
|
7
7
|
|
|
8
8
|
// src/constants.ts
|
|
9
9
|
var VERSION = version;
|
|
@@ -164,6 +164,12 @@ function vitePluginWeapp(ctx) {
|
|
|
164
164
|
function relative(p) {
|
|
165
165
|
return path4.relative(configResolved.root, p);
|
|
166
166
|
}
|
|
167
|
+
function transformAbsoluteToRelative(p) {
|
|
168
|
+
if (path4.isAbsolute(p)) {
|
|
169
|
+
return relative(p);
|
|
170
|
+
}
|
|
171
|
+
return p;
|
|
172
|
+
}
|
|
167
173
|
function getInputOption(entries) {
|
|
168
174
|
return entries.reduce((acc, cur) => {
|
|
169
175
|
acc[relative(cur)] = cur;
|
|
@@ -191,18 +197,9 @@ function vitePluginWeapp(ctx) {
|
|
|
191
197
|
async buildStart() {
|
|
192
198
|
const { build: build2 } = configResolved;
|
|
193
199
|
const ignore = [
|
|
194
|
-
...defaultExcluded
|
|
200
|
+
...defaultExcluded,
|
|
201
|
+
`${build2.outDir}/**`
|
|
195
202
|
];
|
|
196
|
-
ignore.push(
|
|
197
|
-
...[
|
|
198
|
-
`${build2.outDir}/**`,
|
|
199
|
-
"project.config.json",
|
|
200
|
-
"project.private.config.json",
|
|
201
|
-
"package.json",
|
|
202
|
-
"tsconfig.json",
|
|
203
|
-
"tsconfig.node.json"
|
|
204
|
-
]
|
|
205
|
-
);
|
|
206
203
|
const relFiles = await new Fdir().withRelativePaths().globWithOptions(
|
|
207
204
|
[path4.join(ctx.srcRoot ?? "", "**/*.{wxml,wxs,png,jpg,jpeg,gif,svg,webp}")],
|
|
208
205
|
{
|
|
@@ -266,9 +263,9 @@ function vitePluginWeapp(ctx) {
|
|
|
266
263
|
}
|
|
267
264
|
},
|
|
268
265
|
// for debug
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
266
|
+
watchChange(id, change) {
|
|
267
|
+
logger_default.success(`[${change.event}] ${transformAbsoluteToRelative(id)}`);
|
|
268
|
+
},
|
|
272
269
|
generateBundle(_options, bundle) {
|
|
273
270
|
const bundleKeys = Object.keys(bundle);
|
|
274
271
|
for (const bundleKey of bundleKeys) {
|
|
@@ -389,7 +386,7 @@ var CompilerContext = class {
|
|
|
389
386
|
const getWatcher = (paths, opts, inlineConfig2) => {
|
|
390
387
|
const watcher = watch(paths, opts);
|
|
391
388
|
let isReady = false;
|
|
392
|
-
watcher.on("all", async (eventName) => {
|
|
389
|
+
watcher.on("all", async (eventName, _p) => {
|
|
393
390
|
if (isReady && (eventName === "add" || eventName === "change" || eventName === "unlink")) {
|
|
394
391
|
await this.internalDev(inlineConfig2);
|
|
395
392
|
}
|
package/dist/cli.cjs
CHANGED
|
@@ -32,7 +32,7 @@ var import_cac = require("cac");
|
|
|
32
32
|
var import_weapp_ide_cli = require("weapp-ide-cli");
|
|
33
33
|
|
|
34
34
|
// package.json
|
|
35
|
-
var version = "1.3.
|
|
35
|
+
var version = "1.3.4";
|
|
36
36
|
|
|
37
37
|
// src/constants.ts
|
|
38
38
|
var VERSION = version;
|
|
@@ -197,6 +197,12 @@ function vitePluginWeapp(ctx) {
|
|
|
197
197
|
function relative(p) {
|
|
198
198
|
return import_pathe4.default.relative(configResolved.root, p);
|
|
199
199
|
}
|
|
200
|
+
function transformAbsoluteToRelative(p) {
|
|
201
|
+
if (import_pathe4.default.isAbsolute(p)) {
|
|
202
|
+
return relative(p);
|
|
203
|
+
}
|
|
204
|
+
return p;
|
|
205
|
+
}
|
|
200
206
|
function getInputOption(entries) {
|
|
201
207
|
return entries.reduce((acc, cur) => {
|
|
202
208
|
acc[relative(cur)] = cur;
|
|
@@ -224,18 +230,9 @@ function vitePluginWeapp(ctx) {
|
|
|
224
230
|
async buildStart() {
|
|
225
231
|
const { build: build2 } = configResolved;
|
|
226
232
|
const ignore = [
|
|
227
|
-
...defaultExcluded
|
|
233
|
+
...defaultExcluded,
|
|
234
|
+
`${build2.outDir}/**`
|
|
228
235
|
];
|
|
229
|
-
ignore.push(
|
|
230
|
-
...[
|
|
231
|
-
`${build2.outDir}/**`,
|
|
232
|
-
"project.config.json",
|
|
233
|
-
"project.private.config.json",
|
|
234
|
-
"package.json",
|
|
235
|
-
"tsconfig.json",
|
|
236
|
-
"tsconfig.node.json"
|
|
237
|
-
]
|
|
238
|
-
);
|
|
239
236
|
const relFiles = await new import_fdir.fdir().withRelativePaths().globWithOptions(
|
|
240
237
|
[import_pathe4.default.join(ctx.srcRoot ?? "", "**/*.{wxml,wxs,png,jpg,jpeg,gif,svg,webp}")],
|
|
241
238
|
{
|
|
@@ -299,9 +296,9 @@ function vitePluginWeapp(ctx) {
|
|
|
299
296
|
}
|
|
300
297
|
},
|
|
301
298
|
// for debug
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
299
|
+
watchChange(id, change) {
|
|
300
|
+
logger_default.success(`[${change.event}] ${transformAbsoluteToRelative(id)}`);
|
|
301
|
+
},
|
|
305
302
|
generateBundle(_options, bundle) {
|
|
306
303
|
const bundleKeys = Object.keys(bundle);
|
|
307
304
|
for (const bundleKey of bundleKeys) {
|
|
@@ -422,7 +419,7 @@ var CompilerContext = class {
|
|
|
422
419
|
const getWatcher = (paths, opts, inlineConfig2) => {
|
|
423
420
|
const watcher = (0, import_chokidar.watch)(paths, opts);
|
|
424
421
|
let isReady = false;
|
|
425
|
-
watcher.on("all", async (eventName) => {
|
|
422
|
+
watcher.on("all", async (eventName, _p) => {
|
|
426
423
|
if (isReady && (eventName === "add" || eventName === "change" || eventName === "unlink")) {
|
|
427
424
|
await this.internalDev(inlineConfig2);
|
|
428
425
|
}
|
package/dist/cli.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -201,6 +201,12 @@ function vitePluginWeapp(ctx) {
|
|
|
201
201
|
function relative(p) {
|
|
202
202
|
return import_pathe4.default.relative(configResolved.root, p);
|
|
203
203
|
}
|
|
204
|
+
function transformAbsoluteToRelative(p) {
|
|
205
|
+
if (import_pathe4.default.isAbsolute(p)) {
|
|
206
|
+
return relative(p);
|
|
207
|
+
}
|
|
208
|
+
return p;
|
|
209
|
+
}
|
|
204
210
|
function getInputOption(entries) {
|
|
205
211
|
return entries.reduce((acc, cur) => {
|
|
206
212
|
acc[relative(cur)] = cur;
|
|
@@ -228,18 +234,9 @@ function vitePluginWeapp(ctx) {
|
|
|
228
234
|
async buildStart() {
|
|
229
235
|
const { build: build2 } = configResolved;
|
|
230
236
|
const ignore = [
|
|
231
|
-
...defaultExcluded
|
|
237
|
+
...defaultExcluded,
|
|
238
|
+
`${build2.outDir}/**`
|
|
232
239
|
];
|
|
233
|
-
ignore.push(
|
|
234
|
-
...[
|
|
235
|
-
`${build2.outDir}/**`,
|
|
236
|
-
"project.config.json",
|
|
237
|
-
"project.private.config.json",
|
|
238
|
-
"package.json",
|
|
239
|
-
"tsconfig.json",
|
|
240
|
-
"tsconfig.node.json"
|
|
241
|
-
]
|
|
242
|
-
);
|
|
243
240
|
const relFiles = await new import_fdir.fdir().withRelativePaths().globWithOptions(
|
|
244
241
|
[import_pathe4.default.join(ctx.srcRoot ?? "", "**/*.{wxml,wxs,png,jpg,jpeg,gif,svg,webp}")],
|
|
245
242
|
{
|
|
@@ -303,9 +300,9 @@ function vitePluginWeapp(ctx) {
|
|
|
303
300
|
}
|
|
304
301
|
},
|
|
305
302
|
// for debug
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
303
|
+
watchChange(id, change) {
|
|
304
|
+
logger_default.success(`[${change.event}] ${transformAbsoluteToRelative(id)}`);
|
|
305
|
+
},
|
|
309
306
|
generateBundle(_options, bundle) {
|
|
310
307
|
const bundleKeys = Object.keys(bundle);
|
|
311
308
|
for (const bundleKey of bundleKeys) {
|
|
@@ -426,7 +423,7 @@ var CompilerContext = class {
|
|
|
426
423
|
const getWatcher = (paths, opts, inlineConfig2) => {
|
|
427
424
|
const watcher = (0, import_chokidar.watch)(paths, opts);
|
|
428
425
|
let isReady = false;
|
|
429
|
-
watcher.on("all", async (eventName) => {
|
|
426
|
+
watcher.on("all", async (eventName, _p) => {
|
|
430
427
|
if (isReady && (eventName === "add" || eventName === "change" || eventName === "unlink")) {
|
|
431
428
|
await this.internalDev(inlineConfig2);
|
|
432
429
|
}
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.4",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"tsup": "^8.3.0",
|
|
63
63
|
"vite-tsconfig-paths": "^5.0.1",
|
|
64
64
|
"@weapp-core/init": "^1.0.5",
|
|
65
|
-
"@weapp-core/logger": "^1.0.1",
|
|
66
65
|
"weapp-ide-cli": "^2.0.6",
|
|
67
|
-
"@weapp-core/shared": "^1.0.1"
|
|
66
|
+
"@weapp-core/shared": "^1.0.1",
|
|
67
|
+
"@weapp-core/logger": "^1.0.1"
|
|
68
68
|
},
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public",
|