weapp-vite 1.6.5 → 1.6.6

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.
@@ -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.6.5";
6
+ var version = "1.6.6";
7
7
 
8
8
  // src/constants.ts
9
9
  var VERSION = version;
@@ -300,7 +300,8 @@ function vitePluginWeapp(ctx, subPackageMeta) {
300
300
  ignore.push(...resolveGlobs(weapp?.copy?.exclude));
301
301
  const targetDir = subPackageMeta ? path4.join(ctx.srcRoot, subPackageMeta.subPackage.root) : ctx.srcRoot;
302
302
  const assetGlobs = [
303
- "**/*.{wxml,wxs}",
303
+ // 支持 html
304
+ "**/*.{wxml,html,wxs}",
304
305
  "**/*.{png,jpg,jpeg,gif,svg,webp}"
305
306
  ];
306
307
  assetGlobs.push(...resolveGlobs(weapp?.copy?.include));
@@ -324,9 +325,16 @@ function vitePluginWeapp(ctx, subPackageMeta) {
324
325
  this.addWatchFile(filepath);
325
326
  const isMedia = !/\.(?:wxml|wxs)$/.test(file);
326
327
  const isWxml = /\.wxml$/.test(file);
328
+ const isHtml = /\.html$/.test(file);
327
329
  const source = isMedia ? await fs4.readFile(filepath) : await fs4.readFile(filepath, "utf8");
328
330
  const fileName = ctx.relativeSrcRoot(file);
329
- if (isWxml) {
331
+ if (isHtml) {
332
+ this.emitFile({
333
+ type: "asset",
334
+ fileName: changeFileExtension(fileName, "wxml"),
335
+ source
336
+ });
337
+ } else if (isWxml) {
330
338
  this.emitFile({
331
339
  type: "asset",
332
340
  fileName,
package/dist/cli.cjs CHANGED
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
 
25
- // ../../node_modules/.pnpm/tsup@8.3.0_@swc+core@1.7.36_jiti@2.3.1_postcss@8.4.47_tsx@4.19.1_typescript@5.6.3_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
25
+ // ../../node_modules/.pnpm/tsup@8.3.5_@swc+core@1.7.40_jiti@2.3.1_postcss@8.4.47_tsx@4.19.2_typescript@5.6.3_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
26
26
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
27
27
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
28
28
 
@@ -34,7 +34,7 @@ var import_vite3 = require("vite");
34
34
  var import_weapp_ide_cli = require("weapp-ide-cli");
35
35
 
36
36
  // package.json
37
- var version = "1.6.5";
37
+ var version = "1.6.6";
38
38
 
39
39
  // src/constants.ts
40
40
  var VERSION = version;
@@ -335,7 +335,8 @@ function vitePluginWeapp(ctx, subPackageMeta) {
335
335
  ignore.push(...resolveGlobs(weapp?.copy?.exclude));
336
336
  const targetDir = subPackageMeta ? import_pathe4.default.join(ctx.srcRoot, subPackageMeta.subPackage.root) : ctx.srcRoot;
337
337
  const assetGlobs = [
338
- "**/*.{wxml,wxs}",
338
+ // 支持 html
339
+ "**/*.{wxml,html,wxs}",
339
340
  "**/*.{png,jpg,jpeg,gif,svg,webp}"
340
341
  ];
341
342
  assetGlobs.push(...resolveGlobs(weapp?.copy?.include));
@@ -359,9 +360,16 @@ function vitePluginWeapp(ctx, subPackageMeta) {
359
360
  this.addWatchFile(filepath);
360
361
  const isMedia = !/\.(?:wxml|wxs)$/.test(file);
361
362
  const isWxml = /\.wxml$/.test(file);
363
+ const isHtml = /\.html$/.test(file);
362
364
  const source = isMedia ? await import_fs_extra4.default.readFile(filepath) : await import_fs_extra4.default.readFile(filepath, "utf8");
363
365
  const fileName = ctx.relativeSrcRoot(file);
364
- if (isWxml) {
366
+ if (isHtml) {
367
+ this.emitFile({
368
+ type: "asset",
369
+ fileName: changeFileExtension(fileName, "wxml"),
370
+ source
371
+ });
372
+ } else if (isWxml) {
365
373
  this.emitFile({
366
374
  type: "asset",
367
375
  fileName,
package/dist/cli.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  VERSION,
3
3
  createCompilerContext,
4
4
  logger_default
5
- } from "./chunk-ILTMPLJJ.mjs";
5
+ } from "./chunk-MF2E2WZT.mjs";
6
6
  import "./chunk-444MQSSG.mjs";
7
7
 
8
8
  // src/cli.ts
package/dist/index.cjs CHANGED
@@ -35,7 +35,7 @@ __export(src_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(src_exports);
37
37
 
38
- // ../../node_modules/.pnpm/tsup@8.3.0_@swc+core@1.7.36_jiti@2.3.1_postcss@8.4.47_tsx@4.19.1_typescript@5.6.3_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
38
+ // ../../node_modules/.pnpm/tsup@8.3.5_@swc+core@1.7.40_jiti@2.3.1_postcss@8.4.47_tsx@4.19.2_typescript@5.6.3_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
39
39
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
40
40
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
41
41
 
@@ -337,7 +337,8 @@ function vitePluginWeapp(ctx, subPackageMeta) {
337
337
  ignore.push(...resolveGlobs(weapp?.copy?.exclude));
338
338
  const targetDir = subPackageMeta ? import_pathe4.default.join(ctx.srcRoot, subPackageMeta.subPackage.root) : ctx.srcRoot;
339
339
  const assetGlobs = [
340
- "**/*.{wxml,wxs}",
340
+ // 支持 html
341
+ "**/*.{wxml,html,wxs}",
341
342
  "**/*.{png,jpg,jpeg,gif,svg,webp}"
342
343
  ];
343
344
  assetGlobs.push(...resolveGlobs(weapp?.copy?.include));
@@ -361,9 +362,16 @@ function vitePluginWeapp(ctx, subPackageMeta) {
361
362
  this.addWatchFile(filepath);
362
363
  const isMedia = !/\.(?:wxml|wxs)$/.test(file);
363
364
  const isWxml = /\.wxml$/.test(file);
365
+ const isHtml = /\.html$/.test(file);
364
366
  const source = isMedia ? await import_fs_extra4.default.readFile(filepath) : await import_fs_extra4.default.readFile(filepath, "utf8");
365
367
  const fileName = ctx.relativeSrcRoot(file);
366
- if (isWxml) {
368
+ if (isHtml) {
369
+ this.emitFile({
370
+ type: "asset",
371
+ fileName: changeFileExtension(fileName, "wxml"),
372
+ source
373
+ });
374
+ } else if (isWxml) {
367
375
  this.emitFile({
368
376
  type: "asset",
369
377
  fileName,
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CompilerContext,
3
3
  createCompilerContext
4
- } from "./chunk-ILTMPLJJ.mjs";
4
+ } from "./chunk-MF2E2WZT.mjs";
5
5
  import "./chunk-444MQSSG.mjs";
6
6
  export {
7
7
  CompilerContext,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-vite",
3
3
  "type": "module",
4
- "version": "1.6.5",
4
+ "version": "1.6.6",
5
5
  "description": "weapp-vite 一个现代化的小程序打包工具",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -71,22 +71,22 @@
71
71
  "magic-string": "^0.30.12",
72
72
  "pathe": "^1.1.2",
73
73
  "picomatch": "^4.0.2",
74
- "tsup": "^8.3.0",
75
- "tsx": "^4.19.1",
74
+ "tsup": "^8.3.5",
75
+ "tsx": "^4.19.2",
76
76
  "vite-tsconfig-paths": "^5.0.1",
77
77
  "@weapp-core/init": "^1.1.6",
78
- "@weapp-core/logger": "^1.0.1",
79
78
  "@weapp-core/schematics": "^1.0.3",
80
79
  "@weapp-core/shared": "^1.0.3",
81
- "weapp-ide-cli": "^2.0.6"
80
+ "weapp-ide-cli": "^2.0.6",
81
+ "@weapp-core/logger": "^1.0.1"
82
82
  },
83
83
  "publishConfig": {
84
84
  "access": "public",
85
85
  "registry": "https://registry.npmjs.org"
86
86
  },
87
87
  "devDependencies": {
88
- "@babel/parser": "^7.25.8",
89
- "@babel/traverse": "^7.25.7",
88
+ "@babel/parser": "^7.26.1",
89
+ "@babel/traverse": "^7.25.9",
90
90
  "htmlparser2": "^9.1.0"
91
91
  },
92
92
  "scripts": {