weapp-vite 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-JKTPETKK.mjs → chunk-LYCBVJHR.mjs} +53 -50
- package/dist/cli.cjs +53 -50
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +52 -49
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -95,7 +95,7 @@ var logger_default = logger;
|
|
|
95
95
|
init_esm_shims();
|
|
96
96
|
|
|
97
97
|
// package.json
|
|
98
|
-
var version = "1.8.
|
|
98
|
+
var version = "1.8.1";
|
|
99
99
|
|
|
100
100
|
// src/constants.ts
|
|
101
101
|
var VERSION = version;
|
|
@@ -840,58 +840,60 @@ function vitePluginWeapp(ctx, subPackageMeta) {
|
|
|
840
840
|
});
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
843
|
+
await Promise.all([
|
|
844
|
+
...wxmlFiles.map(async ({ filePath, fileName, isHtml }) => {
|
|
845
|
+
const source = await fs4.readFile(filePath, "utf8");
|
|
846
|
+
let _source;
|
|
847
|
+
if (weapp?.enhance?.wxml) {
|
|
848
|
+
const { code, deps } = processWxml(source);
|
|
849
|
+
_source = code;
|
|
850
|
+
for (const wxsDep of deps.filter((x) => x.tagName === "wxs")) {
|
|
851
|
+
if (jsExtensions.includes(wxsDep.attrs.lang) || /\.wxs\.[jt]s$/.test(wxsDep.value)) {
|
|
852
|
+
const wxsPath = path4.resolve(path4.dirname(filePath), wxsDep.value);
|
|
853
|
+
if (await fs4.exists(wxsPath)) {
|
|
854
|
+
cachedWatchFiles.push(wxsPath);
|
|
855
|
+
const code2 = await fs4.readFile(wxsPath, "utf8");
|
|
856
|
+
const res = transformWxsCode(code2, {
|
|
857
|
+
filename: wxsPath
|
|
858
|
+
});
|
|
859
|
+
if (res && res.code) {
|
|
860
|
+
cachedEmittedFiles.push(
|
|
861
|
+
{
|
|
862
|
+
type: "asset",
|
|
863
|
+
fileName: ctx.relativeSrcRoot(relative(removeExtension(wxsPath))),
|
|
864
|
+
source: res.code
|
|
865
|
+
}
|
|
866
|
+
);
|
|
867
|
+
}
|
|
866
868
|
}
|
|
867
869
|
}
|
|
868
870
|
}
|
|
871
|
+
} else {
|
|
872
|
+
_source = source;
|
|
869
873
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
});
|
|
894
|
-
}
|
|
874
|
+
cachedEmittedFiles.push({
|
|
875
|
+
type: "asset",
|
|
876
|
+
fileName: isHtml ? changeFileExtension(fileName, ctx.outputExtensions.wxml) : fileName,
|
|
877
|
+
source: _source
|
|
878
|
+
});
|
|
879
|
+
}),
|
|
880
|
+
...wxsFiles.map(async ({ fileName, filePath }) => {
|
|
881
|
+
const source = await fs4.readFile(filePath);
|
|
882
|
+
cachedEmittedFiles.push({
|
|
883
|
+
type: "asset",
|
|
884
|
+
fileName,
|
|
885
|
+
source
|
|
886
|
+
});
|
|
887
|
+
}),
|
|
888
|
+
...mediaFiles.map(async ({ fileName, filePath }) => {
|
|
889
|
+
const source = await fs4.readFile(filePath);
|
|
890
|
+
cachedEmittedFiles.push({
|
|
891
|
+
type: "asset",
|
|
892
|
+
fileName,
|
|
893
|
+
source
|
|
894
|
+
});
|
|
895
|
+
})
|
|
896
|
+
]);
|
|
895
897
|
debug?.(ctx.potentialComponentEntries);
|
|
896
898
|
if (subPackageMeta) {
|
|
897
899
|
entriesSet = subPackageMeta.entriesSet;
|
|
@@ -1421,7 +1423,8 @@ var CompilerContext = class {
|
|
|
1421
1423
|
},
|
|
1422
1424
|
sourcemap: false,
|
|
1423
1425
|
config: false,
|
|
1424
|
-
|
|
1426
|
+
// https://tsup.egoist.dev/#compile-time-environment-variables
|
|
1427
|
+
env: {
|
|
1425
1428
|
NODE_ENV: "production"
|
|
1426
1429
|
}
|
|
1427
1430
|
// external: [],
|
package/dist/cli.cjs
CHANGED
|
@@ -130,7 +130,7 @@ var import_weapp_ide_cli = require("weapp-ide-cli");
|
|
|
130
130
|
init_cjs_shims();
|
|
131
131
|
|
|
132
132
|
// package.json
|
|
133
|
-
var version = "1.8.
|
|
133
|
+
var version = "1.8.1";
|
|
134
134
|
|
|
135
135
|
// src/constants.ts
|
|
136
136
|
var VERSION = version;
|
|
@@ -880,58 +880,60 @@ function vitePluginWeapp(ctx, subPackageMeta) {
|
|
|
880
880
|
});
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
883
|
+
await Promise.all([
|
|
884
|
+
...wxmlFiles.map(async ({ filePath, fileName, isHtml }) => {
|
|
885
|
+
const source = await import_fs_extra4.default.readFile(filePath, "utf8");
|
|
886
|
+
let _source;
|
|
887
|
+
if (weapp?.enhance?.wxml) {
|
|
888
|
+
const { code, deps } = processWxml(source);
|
|
889
|
+
_source = code;
|
|
890
|
+
for (const wxsDep of deps.filter((x) => x.tagName === "wxs")) {
|
|
891
|
+
if (jsExtensions.includes(wxsDep.attrs.lang) || /\.wxs\.[jt]s$/.test(wxsDep.value)) {
|
|
892
|
+
const wxsPath = import_pathe4.default.resolve(import_pathe4.default.dirname(filePath), wxsDep.value);
|
|
893
|
+
if (await import_fs_extra4.default.exists(wxsPath)) {
|
|
894
|
+
cachedWatchFiles.push(wxsPath);
|
|
895
|
+
const code2 = await import_fs_extra4.default.readFile(wxsPath, "utf8");
|
|
896
|
+
const res = transformWxsCode(code2, {
|
|
897
|
+
filename: wxsPath
|
|
898
|
+
});
|
|
899
|
+
if (res && res.code) {
|
|
900
|
+
cachedEmittedFiles.push(
|
|
901
|
+
{
|
|
902
|
+
type: "asset",
|
|
903
|
+
fileName: ctx.relativeSrcRoot(relative((0, import_shared5.removeExtension)(wxsPath))),
|
|
904
|
+
source: res.code
|
|
905
|
+
}
|
|
906
|
+
);
|
|
907
|
+
}
|
|
906
908
|
}
|
|
907
909
|
}
|
|
908
910
|
}
|
|
911
|
+
} else {
|
|
912
|
+
_source = source;
|
|
909
913
|
}
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
});
|
|
934
|
-
}
|
|
914
|
+
cachedEmittedFiles.push({
|
|
915
|
+
type: "asset",
|
|
916
|
+
fileName: isHtml ? changeFileExtension(fileName, ctx.outputExtensions.wxml) : fileName,
|
|
917
|
+
source: _source
|
|
918
|
+
});
|
|
919
|
+
}),
|
|
920
|
+
...wxsFiles.map(async ({ fileName, filePath }) => {
|
|
921
|
+
const source = await import_fs_extra4.default.readFile(filePath);
|
|
922
|
+
cachedEmittedFiles.push({
|
|
923
|
+
type: "asset",
|
|
924
|
+
fileName,
|
|
925
|
+
source
|
|
926
|
+
});
|
|
927
|
+
}),
|
|
928
|
+
...mediaFiles.map(async ({ fileName, filePath }) => {
|
|
929
|
+
const source = await import_fs_extra4.default.readFile(filePath);
|
|
930
|
+
cachedEmittedFiles.push({
|
|
931
|
+
type: "asset",
|
|
932
|
+
fileName,
|
|
933
|
+
source
|
|
934
|
+
});
|
|
935
|
+
})
|
|
936
|
+
]);
|
|
935
937
|
debug?.(ctx.potentialComponentEntries);
|
|
936
938
|
if (subPackageMeta) {
|
|
937
939
|
entriesSet = subPackageMeta.entriesSet;
|
|
@@ -1464,7 +1466,8 @@ var CompilerContext = class {
|
|
|
1464
1466
|
},
|
|
1465
1467
|
sourcemap: false,
|
|
1466
1468
|
config: false,
|
|
1467
|
-
|
|
1469
|
+
// https://tsup.egoist.dev/#compile-time-environment-variables
|
|
1470
|
+
env: {
|
|
1468
1471
|
NODE_ENV: "production"
|
|
1469
1472
|
}
|
|
1470
1473
|
// external: [],
|
package/dist/cli.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -879,58 +879,60 @@ function vitePluginWeapp(ctx, subPackageMeta) {
|
|
|
879
879
|
});
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
882
|
+
await Promise.all([
|
|
883
|
+
...wxmlFiles.map(async ({ filePath, fileName, isHtml }) => {
|
|
884
|
+
const source = await import_fs_extra4.default.readFile(filePath, "utf8");
|
|
885
|
+
let _source;
|
|
886
|
+
if (weapp?.enhance?.wxml) {
|
|
887
|
+
const { code, deps } = processWxml(source);
|
|
888
|
+
_source = code;
|
|
889
|
+
for (const wxsDep of deps.filter((x) => x.tagName === "wxs")) {
|
|
890
|
+
if (jsExtensions.includes(wxsDep.attrs.lang) || /\.wxs\.[jt]s$/.test(wxsDep.value)) {
|
|
891
|
+
const wxsPath = import_pathe4.default.resolve(import_pathe4.default.dirname(filePath), wxsDep.value);
|
|
892
|
+
if (await import_fs_extra4.default.exists(wxsPath)) {
|
|
893
|
+
cachedWatchFiles.push(wxsPath);
|
|
894
|
+
const code2 = await import_fs_extra4.default.readFile(wxsPath, "utf8");
|
|
895
|
+
const res = transformWxsCode(code2, {
|
|
896
|
+
filename: wxsPath
|
|
897
|
+
});
|
|
898
|
+
if (res && res.code) {
|
|
899
|
+
cachedEmittedFiles.push(
|
|
900
|
+
{
|
|
901
|
+
type: "asset",
|
|
902
|
+
fileName: ctx.relativeSrcRoot(relative((0, import_shared5.removeExtension)(wxsPath))),
|
|
903
|
+
source: res.code
|
|
904
|
+
}
|
|
905
|
+
);
|
|
906
|
+
}
|
|
905
907
|
}
|
|
906
908
|
}
|
|
907
909
|
}
|
|
910
|
+
} else {
|
|
911
|
+
_source = source;
|
|
908
912
|
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
});
|
|
933
|
-
}
|
|
913
|
+
cachedEmittedFiles.push({
|
|
914
|
+
type: "asset",
|
|
915
|
+
fileName: isHtml ? changeFileExtension(fileName, ctx.outputExtensions.wxml) : fileName,
|
|
916
|
+
source: _source
|
|
917
|
+
});
|
|
918
|
+
}),
|
|
919
|
+
...wxsFiles.map(async ({ fileName, filePath }) => {
|
|
920
|
+
const source = await import_fs_extra4.default.readFile(filePath);
|
|
921
|
+
cachedEmittedFiles.push({
|
|
922
|
+
type: "asset",
|
|
923
|
+
fileName,
|
|
924
|
+
source
|
|
925
|
+
});
|
|
926
|
+
}),
|
|
927
|
+
...mediaFiles.map(async ({ fileName, filePath }) => {
|
|
928
|
+
const source = await import_fs_extra4.default.readFile(filePath);
|
|
929
|
+
cachedEmittedFiles.push({
|
|
930
|
+
type: "asset",
|
|
931
|
+
fileName,
|
|
932
|
+
source
|
|
933
|
+
});
|
|
934
|
+
})
|
|
935
|
+
]);
|
|
934
936
|
debug?.(ctx.potentialComponentEntries);
|
|
935
937
|
if (subPackageMeta) {
|
|
936
938
|
entriesSet = subPackageMeta.entriesSet;
|
|
@@ -1463,7 +1465,8 @@ var CompilerContext = class {
|
|
|
1463
1465
|
},
|
|
1464
1466
|
sourcemap: false,
|
|
1465
1467
|
config: false,
|
|
1466
|
-
|
|
1468
|
+
// https://tsup.egoist.dev/#compile-time-environment-variables
|
|
1469
|
+
env: {
|
|
1467
1470
|
NODE_ENV: "production"
|
|
1468
1471
|
}
|
|
1469
1472
|
// external: [],
|
package/dist/index.mjs
CHANGED