weapp-vite 2.1.3 → 2.1.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.
@@ -1,5 +1,5 @@
1
1
  import { R as ResolvedValue } from './types-dS68tjL6.cjs';
2
- import { E as Entry, S as SubPackageMetaValue, R as ResolvedAlias, P as ProjectConfig, M as MpPlatform, W as WeappViteConfig, a as SubPackage, A as AppEntry, b as ScanWxmlOptions } from './config-Cvwqemwg.cjs';
2
+ import { E as Entry, S as SubPackageMetaValue, R as ResolvedAlias, P as ProjectConfig, M as MpPlatform, W as WeappViteConfig, a as SubPackage, A as AppEntry, b as ScanWxmlOptions } from './config-D9TqUhDK.cjs';
3
3
  import { PackageJson } from 'pkg-types';
4
4
  import { InlineConfig } from 'vite';
5
5
  import { RollupWatcher, RollupOutput } from 'rollup';
@@ -107,6 +107,7 @@ declare class ConfigService {
107
107
  get packageJson(): PackageJson;
108
108
  get projectConfig(): ProjectConfig;
109
109
  get srcRoot(): string;
110
+ get absoluteSrcRoot(): string;
110
111
  get mode(): string;
111
112
  get aliasEntries(): ResolvedAlias[];
112
113
  get platform(): MpPlatform;
@@ -1,5 +1,5 @@
1
1
  import { R as ResolvedValue } from './types-dS68tjL6.js';
2
- import { E as Entry, S as SubPackageMetaValue, R as ResolvedAlias, P as ProjectConfig, M as MpPlatform, W as WeappViteConfig, a as SubPackage, A as AppEntry, b as ScanWxmlOptions } from './config-EPV0G671.js';
2
+ import { E as Entry, S as SubPackageMetaValue, R as ResolvedAlias, P as ProjectConfig, M as MpPlatform, W as WeappViteConfig, a as SubPackage, A as AppEntry, b as ScanWxmlOptions } from './config-C-GvdaN9.js';
3
3
  import { PackageJson } from 'pkg-types';
4
4
  import { InlineConfig } from 'vite';
5
5
  import { RollupWatcher, RollupOutput } from 'rollup';
@@ -107,6 +107,7 @@ declare class ConfigService {
107
107
  get packageJson(): PackageJson;
108
108
  get projectConfig(): ProjectConfig;
109
109
  get srcRoot(): string;
110
+ get absoluteSrcRoot(): string;
110
111
  get mode(): string;
111
112
  get aliasEntries(): ResolvedAlias[];
112
113
  get platform(): MpPlatform;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __name,
3
3
  init_esm_shims
4
- } from "../chunk-YKCMB72H.mjs";
4
+ } from "../chunk-HAHM2NKS.mjs";
5
5
 
6
6
  // src/auto-import-components/resolvers/index.ts
7
7
  init_esm_shims();
@@ -3,7 +3,7 @@ import {
3
3
  __name,
4
4
  __toESM,
5
5
  init_esm_shims
6
- } from "./chunk-YKCMB72H.mjs";
6
+ } from "./chunk-HAHM2NKS.mjs";
7
7
 
8
8
  // ../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js
9
9
  var require_Reflect = __commonJS({
@@ -14749,6 +14749,9 @@ var ConfigService2 = class {
14749
14749
  get srcRoot() {
14750
14750
  return this.options.srcRoot;
14751
14751
  }
14752
+ get absoluteSrcRoot() {
14753
+ return path7.resolve(this.cwd, this.srcRoot);
14754
+ }
14752
14755
  get mode() {
14753
14756
  return this.options.mode;
14754
14757
  }
@@ -23135,7 +23138,13 @@ var WxmlService2 = class {
23135
23138
  ...this.configService.weappViteConfig?.enhance?.wxml === true ? {} : this.configService.weappViteConfig?.enhance?.wxml
23136
23139
  });
23137
23140
  this.tokenMap.set(filepath, res);
23138
- await this.addDeps(filepath, res.deps.filter((x4) => isImportTag(x4.tagName) && isTemplate(x4.value)).map((x4) => path14.resolve(dirname3, x4.value)));
23141
+ await this.addDeps(filepath, res.deps.filter((x4) => isImportTag(x4.tagName) && isTemplate(x4.value)).map((x4) => {
23142
+ if (x4.value.startsWith("/")) {
23143
+ return path14.resolve(this.configService.absoluteSrcRoot, x4.value.slice(1));
23144
+ } else {
23145
+ return path14.resolve(dirname3, x4.value);
23146
+ }
23147
+ }));
23139
23148
  return res;
23140
23149
  } else {
23141
23150
  logger_default.warn(`\u5F15\u7528\u6A21\u677F ${this.configService.relativeCwd(filepath)} \u4E0D\u5B58\u5728!`);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __name,
3
3
  init_esm_shims
4
- } from "./chunk-YKCMB72H.mjs";
4
+ } from "./chunk-HAHM2NKS.mjs";
5
5
 
6
6
  // src/config.ts
7
7
  init_esm_shims();
@@ -28,9 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  mod
29
29
  ));
30
30
 
31
- // ../../node_modules/.pnpm/tsup@8.3.6_@swc+core@1.10.15_jiti@2.4.2_postcss@8.5.1_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
31
+ // ../../node_modules/.pnpm/tsup@8.3.6_@swc+core@1.10.15_jiti@2.4.2_postcss@8.5.2_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
32
32
  var init_esm_shims = __esm({
33
- "../../node_modules/.pnpm/tsup@8.3.6_@swc+core@1.10.15_jiti@2.4.2_postcss@8.5.1_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js"() {
33
+ "../../node_modules/.pnpm/tsup@8.3.6_@swc+core@1.10.15_jiti@2.4.2_postcss@8.5.2_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js"() {
34
34
  "use strict";
35
35
  }
36
36
  });
package/dist/cli.cjs CHANGED
@@ -29,10 +29,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  mod
30
30
  ));
31
31
 
32
- // ../../node_modules/.pnpm/tsup@8.3.6_@swc+core@1.10.15_jiti@2.4.2_postcss@8.5.1_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
32
+ // ../../node_modules/.pnpm/tsup@8.3.6_@swc+core@1.10.15_jiti@2.4.2_postcss@8.5.2_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
33
33
  var getImportMetaUrl, importMetaUrl;
34
34
  var init_cjs_shims = __esm({
35
- "../../node_modules/.pnpm/tsup@8.3.6_@swc+core@1.10.15_jiti@2.4.2_postcss@8.5.1_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js"() {
35
+ "../../node_modules/.pnpm/tsup@8.3.6_@swc+core@1.10.15_jiti@2.4.2_postcss@8.5.2_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js"() {
36
36
  "use strict";
37
37
  getImportMetaUrl = /* @__PURE__ */ __name(() => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href, "getImportMetaUrl");
38
38
  importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
@@ -15402,6 +15402,9 @@ var ConfigService2 = class {
15402
15402
  get srcRoot() {
15403
15403
  return this.options.srcRoot;
15404
15404
  }
15405
+ get absoluteSrcRoot() {
15406
+ return import_pathe7.default.resolve(this.cwd, this.srcRoot);
15407
+ }
15405
15408
  get mode() {
15406
15409
  return this.options.mode;
15407
15410
  }
@@ -23790,7 +23793,13 @@ var WxmlService2 = class {
23790
23793
  ...this.configService.weappViteConfig?.enhance?.wxml === true ? {} : this.configService.weappViteConfig?.enhance?.wxml
23791
23794
  });
23792
23795
  this.tokenMap.set(filepath, res);
23793
- await this.addDeps(filepath, res.deps.filter((x4) => isImportTag(x4.tagName) && isTemplate(x4.value)).map((x4) => import_pathe11.default.resolve(dirname3, x4.value)));
23796
+ await this.addDeps(filepath, res.deps.filter((x4) => isImportTag(x4.tagName) && isTemplate(x4.value)).map((x4) => {
23797
+ if (x4.value.startsWith("/")) {
23798
+ return import_pathe11.default.resolve(this.configService.absoluteSrcRoot, x4.value.slice(1));
23799
+ } else {
23800
+ return import_pathe11.default.resolve(dirname3, x4.value);
23801
+ }
23802
+ }));
23794
23803
  return res;
23795
23804
  } else {
23796
23805
  logger_default.warn(`\u5F15\u7528\u6A21\u677F ${this.configService.relativeCwd(filepath)} \u4E0D\u5B58\u5728!`);
package/dist/cli.mjs CHANGED
@@ -3,13 +3,13 @@ import {
3
3
  createCompilerContext,
4
4
  logger_default,
5
5
  require_Reflect
6
- } from "./chunk-GW6NR4HD.mjs";
7
- import "./chunk-NVRSN2SA.mjs";
6
+ } from "./chunk-3X3GXWYT.mjs";
7
+ import "./chunk-CRVQ5UE6.mjs";
8
8
  import {
9
9
  __name,
10
10
  __toESM,
11
11
  init_esm_shims
12
- } from "./chunk-YKCMB72H.mjs";
12
+ } from "./chunk-HAHM2NKS.mjs";
13
13
 
14
14
  // src/cli.ts
15
15
  init_esm_shims();
@@ -56,7 +56,7 @@ type GenerateExtensionsOptions = Partial<{
56
56
  js: 'js' | 'ts' | (string & {});
57
57
  json: 'js' | 'ts' | 'json' | (string & {});
58
58
  wxml: 'wxml' | (string & {});
59
- wxss: 'wxss' | 'scss' | 'less' | (string & {});
59
+ wxss: 'wxss' | 'scss' | 'less' | 'css' | (string & {});
60
60
  }>;
61
61
  type GenerateDirsOptions = Partial<{
62
62
  app: string;
@@ -56,7 +56,7 @@ type GenerateExtensionsOptions = Partial<{
56
56
  js: 'js' | 'ts' | (string & {});
57
57
  json: 'js' | 'ts' | 'json' | (string & {});
58
58
  wxml: 'wxml' | (string & {});
59
- wxss: 'wxss' | 'scss' | 'less' | (string & {});
59
+ wxss: 'wxss' | 'scss' | 'less' | 'css' | (string & {});
60
60
  }>;
61
61
  type GenerateDirsOptions = Partial<{
62
62
  app: string;
package/dist/config.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
2
- export { d as defineConfig } from './config-Cvwqemwg.cjs';
2
+ export { d as defineConfig } from './config-D9TqUhDK.cjs';
3
3
  import './types-dS68tjL6.cjs';
4
4
  import 'tsup';
5
5
  import 'vite-tsconfig-paths';
package/dist/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
2
- export { d as defineConfig } from './config-EPV0G671.js';
2
+ export { d as defineConfig } from './config-C-GvdaN9.js';
3
3
  import './types-dS68tjL6.js';
4
4
  import 'tsup';
5
5
  import 'vite-tsconfig-paths';
package/dist/config.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  defineConfig
3
- } from "./chunk-NVRSN2SA.mjs";
4
- import "./chunk-YKCMB72H.mjs";
3
+ } from "./chunk-CRVQ5UE6.mjs";
4
+ import "./chunk-HAHM2NKS.mjs";
5
5
  export {
6
6
  defineConfig
7
7
  };
package/dist/index.cjs CHANGED
@@ -34,10 +34,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
  ));
35
35
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
36
 
37
- // ../../node_modules/.pnpm/tsup@8.3.6_@swc+core@1.10.15_jiti@2.4.2_postcss@8.5.1_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
37
+ // ../../node_modules/.pnpm/tsup@8.3.6_@swc+core@1.10.15_jiti@2.4.2_postcss@8.5.2_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
38
38
  var getImportMetaUrl, importMetaUrl;
39
39
  var init_cjs_shims = __esm({
40
- "../../node_modules/.pnpm/tsup@8.3.6_@swc+core@1.10.15_jiti@2.4.2_postcss@8.5.1_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js"() {
40
+ "../../node_modules/.pnpm/tsup@8.3.6_@swc+core@1.10.15_jiti@2.4.2_postcss@8.5.2_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js"() {
41
41
  "use strict";
42
42
  getImportMetaUrl = /* @__PURE__ */ __name(() => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href, "getImportMetaUrl");
43
43
  importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
@@ -14806,6 +14806,9 @@ var ConfigService2 = class {
14806
14806
  get srcRoot() {
14807
14807
  return this.options.srcRoot;
14808
14808
  }
14809
+ get absoluteSrcRoot() {
14810
+ return import_pathe7.default.resolve(this.cwd, this.srcRoot);
14811
+ }
14809
14812
  get mode() {
14810
14813
  return this.options.mode;
14811
14814
  }
@@ -23194,7 +23197,13 @@ var WxmlService2 = class {
23194
23197
  ...this.configService.weappViteConfig?.enhance?.wxml === true ? {} : this.configService.weappViteConfig?.enhance?.wxml
23195
23198
  });
23196
23199
  this.tokenMap.set(filepath, res);
23197
- await this.addDeps(filepath, res.deps.filter((x4) => isImportTag(x4.tagName) && isTemplate(x4.value)).map((x4) => import_pathe11.default.resolve(dirname3, x4.value)));
23200
+ await this.addDeps(filepath, res.deps.filter((x4) => isImportTag(x4.tagName) && isTemplate(x4.value)).map((x4) => {
23201
+ if (x4.value.startsWith("/")) {
23202
+ return import_pathe11.default.resolve(this.configService.absoluteSrcRoot, x4.value.slice(1));
23203
+ } else {
23204
+ return import_pathe11.default.resolve(dirname3, x4.value);
23205
+ }
23206
+ }));
23198
23207
  return res;
23199
23208
  } else {
23200
23209
  logger_default.warn(`\u5F15\u7528\u6A21\u677F ${this.configService.relativeCwd(filepath)} \u4E0D\u5B58\u5728!`);
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- export { d as defineConfig } from './config-Cvwqemwg.cjs';
2
- import { L as LoadConfigOptions, C as CompilerContext } from './CompilerContext-DWFbNP11.cjs';
1
+ export { d as defineConfig } from './config-D9TqUhDK.cjs';
2
+ import { L as LoadConfigOptions, C as CompilerContext } from './CompilerContext-C7LldNoo.cjs';
3
3
  export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
4
4
  import './types-dS68tjL6.cjs';
5
5
  import 'tsup';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { d as defineConfig } from './config-EPV0G671.js';
2
- import { L as LoadConfigOptions, C as CompilerContext } from './CompilerContext-BjnJU9GL.js';
1
+ export { d as defineConfig } from './config-C-GvdaN9.js';
2
+ import { L as LoadConfigOptions, C as CompilerContext } from './CompilerContext-D0jeQpYe.js';
3
3
  export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
4
4
  import './types-dS68tjL6.js';
5
5
  import 'tsup';
package/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  createCompilerContext,
3
3
  require_Reflect
4
- } from "./chunk-GW6NR4HD.mjs";
4
+ } from "./chunk-3X3GXWYT.mjs";
5
5
  import {
6
6
  defineConfig
7
- } from "./chunk-NVRSN2SA.mjs";
7
+ } from "./chunk-CRVQ5UE6.mjs";
8
8
  import {
9
9
  __toESM,
10
10
  init_esm_shims
11
- } from "./chunk-YKCMB72H.mjs";
11
+ } from "./chunk-HAHM2NKS.mjs";
12
12
 
13
13
  // src/index.ts
14
14
  init_esm_shims();
package/dist/json.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { App, Page, Component, Sitemap, Theme } from '@weapp-core/schematics';
2
2
  export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
3
- import { C as CompilerContext } from './CompilerContext-DWFbNP11.cjs';
3
+ import { C as CompilerContext } from './CompilerContext-C7LldNoo.cjs';
4
4
  import './types-dS68tjL6.cjs';
5
- import './config-Cvwqemwg.cjs';
5
+ import './config-D9TqUhDK.cjs';
6
6
  import 'vite';
7
7
  import 'tsup';
8
8
  import 'vite-tsconfig-paths';
package/dist/json.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { App, Page, Component, Sitemap, Theme } from '@weapp-core/schematics';
2
2
  export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
3
- import { C as CompilerContext } from './CompilerContext-BjnJU9GL.js';
3
+ import { C as CompilerContext } from './CompilerContext-D0jeQpYe.js';
4
4
  import './types-dS68tjL6.js';
5
- import './config-EPV0G671.js';
5
+ import './config-C-GvdaN9.js';
6
6
  import 'vite';
7
7
  import 'tsup';
8
8
  import 'vite-tsconfig-paths';
package/dist/json.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __name,
3
3
  init_esm_shims
4
- } from "./chunk-YKCMB72H.mjs";
4
+ } from "./chunk-HAHM2NKS.mjs";
5
5
 
6
6
  // src/json.ts
7
7
  init_esm_shims();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-vite",
3
3
  "type": "module",
4
- "version": "2.1.3",
4
+ "version": "2.1.4",
5
5
  "description": "weapp-vite 一个现代化的小程序打包工具",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -92,14 +92,14 @@
92
92
  "fs-extra": "^11.3.0",
93
93
  "pathe": "^2.0.2",
94
94
  "picomatch": "^4.0.2",
95
- "postcss": "^8.5.1",
95
+ "postcss": "^8.5.2",
96
96
  "ts-morph": "^25.0.1",
97
97
  "tsup": "^8.3.6",
98
- "vite": "^5.4.11",
98
+ "vite": "^5.4.14",
99
99
  "vite-tsconfig-paths": "^5.1.4",
100
100
  "@weapp-core/logger": "^1.0.3",
101
- "@weapp-core/init": "^1.1.16",
102
101
  "@weapp-core/schematics": "^1.0.10",
102
+ "@weapp-core/init": "^1.1.16",
103
103
  "@weapp-core/shared": "^1.0.6",
104
104
  "weapp-ide-cli": "^2.0.10"
105
105
  },