@jsenv/core 40.12.9 → 40.12.10
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
|
@@ -7930,12 +7930,14 @@ const jsenvPluginImportMetaCss = () => {
|
|
|
7930
7930
|
if (!usesImportMetaCss) {
|
|
7931
7931
|
return null;
|
|
7932
7932
|
}
|
|
7933
|
-
return injectImportMetaCss(
|
|
7934
|
-
urlInfo
|
|
7935
|
-
|
|
7933
|
+
return injectImportMetaCss(urlInfo, {
|
|
7934
|
+
importAs: urlInfo.context.build
|
|
7935
|
+
? "__installImportMetaCss__"
|
|
7936
|
+
: "installImportMetaCss",
|
|
7937
|
+
specifier: urlInfo.context.build
|
|
7936
7938
|
? importMetaCssBuildFileUrl
|
|
7937
7939
|
: importMetaCssClientFileUrl,
|
|
7938
|
-
);
|
|
7940
|
+
});
|
|
7939
7941
|
},
|
|
7940
7942
|
},
|
|
7941
7943
|
};
|
|
@@ -7972,17 +7974,25 @@ const babelPluginMetadataUsesImportMetaCss = () => {
|
|
|
7972
7974
|
};
|
|
7973
7975
|
};
|
|
7974
7976
|
|
|
7975
|
-
const injectImportMetaCss = (urlInfo,
|
|
7977
|
+
const injectImportMetaCss = (urlInfo, { importAs, specifier }) => {
|
|
7976
7978
|
const importMetaCssClientFileReference = urlInfo.dependencies.inject({
|
|
7977
7979
|
parentUrl: urlInfo.url,
|
|
7978
7980
|
type: "js_import",
|
|
7979
7981
|
expectedType: "js_module",
|
|
7980
|
-
specifier
|
|
7982
|
+
specifier,
|
|
7981
7983
|
});
|
|
7982
|
-
let
|
|
7983
|
-
let
|
|
7984
|
+
let importVariableName;
|
|
7985
|
+
let importBeforeFrom;
|
|
7986
|
+
if (importAs !== "installImportMetaCss") {
|
|
7987
|
+
importBeforeFrom = `{ installImportMetaCss as ${importAs} }`;
|
|
7988
|
+
importVariableName = importAs;
|
|
7989
|
+
} else {
|
|
7990
|
+
importBeforeFrom = `{ installImportMetaCss }`;
|
|
7991
|
+
importVariableName = "installImportMetaCss";
|
|
7992
|
+
}
|
|
7993
|
+
let prelude = `import ${importBeforeFrom} from ${importMetaCssClientFileReference.generatedSpecifier};
|
|
7984
7994
|
|
|
7985
|
-
const remove =
|
|
7995
|
+
const remove = ${importVariableName}(import.meta);
|
|
7986
7996
|
if (import.meta.hot) {
|
|
7987
7997
|
import.meta.hot.dispose(() => {
|
|
7988
7998
|
remove();
|
|
@@ -7990,6 +8000,8 @@ if (import.meta.hot) {
|
|
|
7990
8000
|
}
|
|
7991
8001
|
|
|
7992
8002
|
`;
|
|
8003
|
+
|
|
8004
|
+
let content = urlInfo.content;
|
|
7993
8005
|
return {
|
|
7994
8006
|
content: `${prelude.replace(/\n/g, "")}${content}`,
|
|
7995
8007
|
};
|
|
@@ -7971,12 +7971,14 @@ const jsenvPluginImportMetaCss = () => {
|
|
|
7971
7971
|
if (!usesImportMetaCss) {
|
|
7972
7972
|
return null;
|
|
7973
7973
|
}
|
|
7974
|
-
return injectImportMetaCss(
|
|
7975
|
-
urlInfo
|
|
7976
|
-
|
|
7974
|
+
return injectImportMetaCss(urlInfo, {
|
|
7975
|
+
importAs: urlInfo.context.build
|
|
7976
|
+
? "__installImportMetaCss__"
|
|
7977
|
+
: "installImportMetaCss",
|
|
7978
|
+
specifier: urlInfo.context.build
|
|
7977
7979
|
? importMetaCssBuildFileUrl
|
|
7978
7980
|
: importMetaCssClientFileUrl,
|
|
7979
|
-
);
|
|
7981
|
+
});
|
|
7980
7982
|
},
|
|
7981
7983
|
},
|
|
7982
7984
|
};
|
|
@@ -8013,17 +8015,25 @@ const babelPluginMetadataUsesImportMetaCss = () => {
|
|
|
8013
8015
|
};
|
|
8014
8016
|
};
|
|
8015
8017
|
|
|
8016
|
-
const injectImportMetaCss = (urlInfo,
|
|
8018
|
+
const injectImportMetaCss = (urlInfo, { importAs, specifier }) => {
|
|
8017
8019
|
const importMetaCssClientFileReference = urlInfo.dependencies.inject({
|
|
8018
8020
|
parentUrl: urlInfo.url,
|
|
8019
8021
|
type: "js_import",
|
|
8020
8022
|
expectedType: "js_module",
|
|
8021
|
-
specifier
|
|
8023
|
+
specifier,
|
|
8022
8024
|
});
|
|
8023
|
-
let
|
|
8024
|
-
let
|
|
8025
|
-
|
|
8026
|
-
|
|
8025
|
+
let importVariableName;
|
|
8026
|
+
let importBeforeFrom;
|
|
8027
|
+
if (importAs !== "installImportMetaCss") {
|
|
8028
|
+
importBeforeFrom = `{ installImportMetaCss as ${importAs} }`;
|
|
8029
|
+
importVariableName = importAs;
|
|
8030
|
+
} else {
|
|
8031
|
+
importBeforeFrom = `{ installImportMetaCss }`;
|
|
8032
|
+
importVariableName = "installImportMetaCss";
|
|
8033
|
+
}
|
|
8034
|
+
let prelude = `import ${importBeforeFrom} from ${importMetaCssClientFileReference.generatedSpecifier};
|
|
8035
|
+
|
|
8036
|
+
const remove = ${importVariableName}(import.meta);
|
|
8027
8037
|
if (import.meta.hot) {
|
|
8028
8038
|
import.meta.hot.dispose(() => {
|
|
8029
8039
|
remove();
|
|
@@ -8031,6 +8041,8 @@ if (import.meta.hot) {
|
|
|
8031
8041
|
}
|
|
8032
8042
|
|
|
8033
8043
|
`;
|
|
8044
|
+
|
|
8045
|
+
let content = urlInfo.content;
|
|
8034
8046
|
return {
|
|
8035
8047
|
content: `${prelude.replace(/\n/g, "")}${content}`,
|
|
8036
8048
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "40.12.
|
|
3
|
+
"version": "40.12.10",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
"babel-plugin-transform-async-to-promises": "0.8.18",
|
|
123
123
|
"eslint": "9.39.2",
|
|
124
124
|
"eslint-plugin-import-x": "4.16.2",
|
|
125
|
+
"eslint-plugin-react": "7.37.5",
|
|
125
126
|
"eslint-plugin-regexp": "3.1.0",
|
|
126
127
|
"globals": "17.4.0",
|
|
127
128
|
"open": "11.0.0",
|
|
@@ -140,7 +141,7 @@
|
|
|
140
141
|
"node": ">=20.8.0"
|
|
141
142
|
},
|
|
142
143
|
"volta": {
|
|
143
|
-
"node": "25.1
|
|
144
|
+
"node": "25.8.1",
|
|
144
145
|
"npm": "11.6.2"
|
|
145
146
|
},
|
|
146
147
|
"publishConfig": {
|
|
@@ -50,12 +50,14 @@ export const jsenvPluginImportMetaCss = () => {
|
|
|
50
50
|
if (!usesImportMetaCss) {
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
|
-
return injectImportMetaCss(
|
|
54
|
-
urlInfo
|
|
55
|
-
|
|
53
|
+
return injectImportMetaCss(urlInfo, {
|
|
54
|
+
importAs: urlInfo.context.build
|
|
55
|
+
? "__installImportMetaCss__"
|
|
56
|
+
: "installImportMetaCss",
|
|
57
|
+
specifier: urlInfo.context.build
|
|
56
58
|
? importMetaCssBuildFileUrl
|
|
57
59
|
: importMetaCssClientFileUrl,
|
|
58
|
-
);
|
|
60
|
+
});
|
|
59
61
|
},
|
|
60
62
|
},
|
|
61
63
|
};
|
|
@@ -92,17 +94,25 @@ const babelPluginMetadataUsesImportMetaCss = () => {
|
|
|
92
94
|
};
|
|
93
95
|
};
|
|
94
96
|
|
|
95
|
-
const injectImportMetaCss = (urlInfo,
|
|
97
|
+
const injectImportMetaCss = (urlInfo, { importAs, specifier }) => {
|
|
96
98
|
const importMetaCssClientFileReference = urlInfo.dependencies.inject({
|
|
97
99
|
parentUrl: urlInfo.url,
|
|
98
100
|
type: "js_import",
|
|
99
101
|
expectedType: "js_module",
|
|
100
|
-
specifier
|
|
102
|
+
specifier,
|
|
101
103
|
});
|
|
102
|
-
let
|
|
103
|
-
let
|
|
104
|
+
let importVariableName;
|
|
105
|
+
let importBeforeFrom;
|
|
106
|
+
if (importAs && importAs !== "installImportMetaCss") {
|
|
107
|
+
importBeforeFrom = `{ installImportMetaCss as ${importAs} }`;
|
|
108
|
+
importVariableName = importAs;
|
|
109
|
+
} else {
|
|
110
|
+
importBeforeFrom = `{ installImportMetaCss }`;
|
|
111
|
+
importVariableName = "installImportMetaCss";
|
|
112
|
+
}
|
|
113
|
+
let prelude = `import ${importBeforeFrom} from ${importMetaCssClientFileReference.generatedSpecifier};
|
|
104
114
|
|
|
105
|
-
const remove =
|
|
115
|
+
const remove = ${importVariableName}(import.meta);
|
|
106
116
|
if (import.meta.hot) {
|
|
107
117
|
import.meta.hot.dispose(() => {
|
|
108
118
|
remove();
|
|
@@ -110,6 +120,8 @@ if (import.meta.hot) {
|
|
|
110
120
|
}
|
|
111
121
|
|
|
112
122
|
`;
|
|
123
|
+
|
|
124
|
+
let content = urlInfo.content;
|
|
113
125
|
return {
|
|
114
126
|
content: `${prelude.replace(/\n/g, "")}${content}`,
|
|
115
127
|
};
|