@jsenv/core 40.12.14 → 41.0.0
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/build/build.js
CHANGED
|
@@ -7690,6 +7690,10 @@ const jsenvPluginImportMetaCss = () => {
|
|
|
7690
7690
|
inputUrl: urlInfo.originalUrl,
|
|
7691
7691
|
outputUrl: urlInfo.generatedUrl,
|
|
7692
7692
|
});
|
|
7693
|
+
if (code === urlInfo.content) {
|
|
7694
|
+
// all assignments were already in array form (pre-built file) — nothing to do
|
|
7695
|
+
return null;
|
|
7696
|
+
}
|
|
7693
7697
|
return injectImportMetaCss(urlInfo, {
|
|
7694
7698
|
content: code,
|
|
7695
7699
|
importFrom: importMetaCssBuildClientFileUrl,
|
|
@@ -7731,6 +7735,10 @@ const babelPluginRewriteImportMetaCssAssignment = (
|
|
|
7731
7735
|
if (property.name !== "css") {
|
|
7732
7736
|
return;
|
|
7733
7737
|
}
|
|
7738
|
+
// already transformed (e.g. pre-built file): leave as-is
|
|
7739
|
+
if (right.type === "ArrayExpression") {
|
|
7740
|
+
return;
|
|
7741
|
+
}
|
|
7734
7742
|
path.node.right = t.arrayExpression([
|
|
7735
7743
|
right,
|
|
7736
7744
|
t.stringLiteral(relativeUrl),
|
|
@@ -7731,6 +7731,10 @@ const jsenvPluginImportMetaCss = () => {
|
|
|
7731
7731
|
inputUrl: urlInfo.originalUrl,
|
|
7732
7732
|
outputUrl: urlInfo.generatedUrl,
|
|
7733
7733
|
});
|
|
7734
|
+
if (code === urlInfo.content) {
|
|
7735
|
+
// all assignments were already in array form (pre-built file) — nothing to do
|
|
7736
|
+
return null;
|
|
7737
|
+
}
|
|
7734
7738
|
return injectImportMetaCss(urlInfo, {
|
|
7735
7739
|
content: code,
|
|
7736
7740
|
importFrom: importMetaCssBuildClientFileUrl,
|
|
@@ -7772,6 +7776,10 @@ const babelPluginRewriteImportMetaCssAssignment = (
|
|
|
7772
7776
|
if (property.name !== "css") {
|
|
7773
7777
|
return;
|
|
7774
7778
|
}
|
|
7779
|
+
// already transformed (e.g. pre-built file): leave as-is
|
|
7780
|
+
if (right.type === "ArrayExpression") {
|
|
7781
|
+
return;
|
|
7782
|
+
}
|
|
7775
7783
|
path.node.right = t.arrayExpression([
|
|
7776
7784
|
right,
|
|
7777
7785
|
t.stringLiteral(relativeUrl),
|
package/package.json
CHANGED
|
@@ -64,6 +64,10 @@ export const jsenvPluginImportMetaCss = () => {
|
|
|
64
64
|
inputUrl: urlInfo.originalUrl,
|
|
65
65
|
outputUrl: urlInfo.generatedUrl,
|
|
66
66
|
});
|
|
67
|
+
if (code === urlInfo.content) {
|
|
68
|
+
// all assignments were already in array form (pre-built file) — nothing to do
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
67
71
|
return injectImportMetaCss(urlInfo, {
|
|
68
72
|
content: code,
|
|
69
73
|
importFrom: importMetaCssBuildClientFileUrl,
|
|
@@ -105,6 +109,10 @@ const babelPluginRewriteImportMetaCssAssignment = (
|
|
|
105
109
|
if (property.name !== "css") {
|
|
106
110
|
return;
|
|
107
111
|
}
|
|
112
|
+
// already transformed (e.g. pre-built file): leave as-is
|
|
113
|
+
if (right.type === "ArrayExpression") {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
108
116
|
path.node.right = t.arrayExpression([
|
|
109
117
|
right,
|
|
110
118
|
t.stringLiteral(relativeUrl),
|