@dimina/compiler 1.0.15 → 1.0.16

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.
@@ -10,7 +10,7 @@ chokidar = require_env.__toESM(chokidar, 1);
10
10
  let commander = require("commander");
11
11
  var package_default = {
12
12
  name: "@dimina/compiler",
13
- version: "1.0.15",
13
+ version: "1.0.16",
14
14
  description: "星河编译工具",
15
15
  main: "./dist/index.cjs",
16
16
  module: "./dist/index.js",
package/dist/bin/index.js CHANGED
@@ -6,7 +6,7 @@ import chokidar from "chokidar";
6
6
  import { program } from "commander";
7
7
  var package_default = {
8
8
  name: "@dimina/compiler",
9
- version: "1.0.15",
9
+ version: "1.0.16",
10
10
  description: "星河编译工具",
11
11
  main: "./dist/index.cjs",
12
12
  module: "./dist/index.js",
@@ -99,9 +99,10 @@ async function buildCompileCss(module, depthChain = [], compiledPaths = /* @__PU
99
99
  async function enhanceCSS(module) {
100
100
  const absolutePath = module.absolutePath ? module.absolutePath : getAbsolutePath(module.path);
101
101
  if (!absolutePath) return "";
102
+ const cacheKey = `${absolutePath}::${module.id || ""}`;
102
103
  const inputCSS = require_env.getContentByPath(absolutePath);
103
104
  if (!inputCSS) return "";
104
- if (compileRes.has(absolutePath)) return compileRes.get(absolutePath);
105
+ if (compileRes.has(cacheKey)) return compileRes.get(cacheKey);
105
106
  let processedCSS = normalizeRootStyleImports(inputCSS);
106
107
  const ext = node_path.default.extname(absolutePath).toLowerCase();
107
108
  try {
@@ -158,7 +159,7 @@ async function enhanceCSS(module) {
158
159
  const cleanedCode = await removeBaseComponentScope(scopedCode, moduleId);
159
160
  const res = await (0, postcss.default)([(0, autoprefixer.default)({ overrideBrowserslist: ["cover 99.5%"] }), (0, cssnano.default)()]).process(cleanedCode, { from: void 0 });
160
161
  const result = (await Promise.all(promises)).filter(Boolean).join("") + res.css;
161
- compileRes.set(absolutePath, result);
162
+ compileRes.set(cacheKey, result);
162
163
  return result;
163
164
  }
164
165
  function normalizeCssUrlValue(value, absolutePath) {
@@ -90,9 +90,10 @@ async function buildCompileCss(module, depthChain = [], compiledPaths = /* @__PU
90
90
  async function enhanceCSS(module) {
91
91
  const absolutePath = module.absolutePath ? module.absolutePath : getAbsolutePath(module.path);
92
92
  if (!absolutePath) return "";
93
+ const cacheKey = `${absolutePath}::${module.id || ""}`;
93
94
  const inputCSS = getContentByPath(absolutePath);
94
95
  if (!inputCSS) return "";
95
- if (compileRes.has(absolutePath)) return compileRes.get(absolutePath);
96
+ if (compileRes.has(cacheKey)) return compileRes.get(cacheKey);
96
97
  let processedCSS = normalizeRootStyleImports(inputCSS);
97
98
  const ext = path.extname(absolutePath).toLowerCase();
98
99
  try {
@@ -149,7 +150,7 @@ async function enhanceCSS(module) {
149
150
  const cleanedCode = await removeBaseComponentScope(scopedCode, moduleId);
150
151
  const res = await postcss([autoprefixer({ overrideBrowserslist: ["cover 99.5%"] }), cssnano()]).process(cleanedCode, { from: void 0 });
151
152
  const result = (await Promise.all(promises)).filter(Boolean).join("") + res.css;
152
- compileRes.set(absolutePath, result);
153
+ compileRes.set(cacheKey, result);
153
154
  return result;
154
155
  }
155
156
  function normalizeCssUrlValue(value, absolutePath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimina/compiler",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "星河编译工具",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",