@jsenv/core 41.0.0 → 41.0.1
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
|
@@ -7677,10 +7677,15 @@ const jsenvPluginImportMetaCss = () => {
|
|
|
7677
7677
|
return null;
|
|
7678
7678
|
}
|
|
7679
7679
|
if (urlInfo.context.build) {
|
|
7680
|
-
const
|
|
7681
|
-
const
|
|
7682
|
-
|
|
7680
|
+
const packageName = urlInfo.packageName;
|
|
7681
|
+
const packageDirectoryUrl =
|
|
7682
|
+
urlInfo.packageDirectoryUrl || urlInfo.context.rootDirectoryUrl;
|
|
7683
|
+
const relativePathInPackage = urlInfo.originalUrl.slice(
|
|
7684
|
+
packageDirectoryUrl.length - 1,
|
|
7683
7685
|
);
|
|
7686
|
+
const relativeUrl = packageName
|
|
7687
|
+
? `${packageName}${relativePathInPackage}`
|
|
7688
|
+
: relativePathInPackage;
|
|
7684
7689
|
const { code } = await applyBabelPlugins({
|
|
7685
7690
|
babelPlugins: [
|
|
7686
7691
|
[babelPluginRewriteImportMetaCssAssignment, { relativeUrl }],
|
|
@@ -7718,10 +7718,15 @@ const jsenvPluginImportMetaCss = () => {
|
|
|
7718
7718
|
return null;
|
|
7719
7719
|
}
|
|
7720
7720
|
if (urlInfo.context.build) {
|
|
7721
|
-
const
|
|
7722
|
-
const
|
|
7723
|
-
|
|
7721
|
+
const packageName = urlInfo.packageName;
|
|
7722
|
+
const packageDirectoryUrl =
|
|
7723
|
+
urlInfo.packageDirectoryUrl || urlInfo.context.rootDirectoryUrl;
|
|
7724
|
+
const relativePathInPackage = urlInfo.originalUrl.slice(
|
|
7725
|
+
packageDirectoryUrl.length - 1,
|
|
7724
7726
|
);
|
|
7727
|
+
const relativeUrl = packageName
|
|
7728
|
+
? `${packageName}${relativePathInPackage}`
|
|
7729
|
+
: relativePathInPackage;
|
|
7725
7730
|
const { code } = await applyBabelPlugins({
|
|
7726
7731
|
babelPlugins: [
|
|
7727
7732
|
[babelPluginRewriteImportMetaCssAssignment, { relativeUrl }],
|
package/package.json
CHANGED
|
@@ -51,10 +51,15 @@ export const jsenvPluginImportMetaCss = () => {
|
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
53
|
if (urlInfo.context.build) {
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
|
|
54
|
+
const packageName = urlInfo.packageName;
|
|
55
|
+
const packageDirectoryUrl =
|
|
56
|
+
urlInfo.packageDirectoryUrl || urlInfo.context.rootDirectoryUrl;
|
|
57
|
+
const relativePathInPackage = urlInfo.originalUrl.slice(
|
|
58
|
+
packageDirectoryUrl.length - 1,
|
|
57
59
|
);
|
|
60
|
+
const relativeUrl = packageName
|
|
61
|
+
? `${packageName}${relativePathInPackage}`
|
|
62
|
+
: relativePathInPackage;
|
|
58
63
|
const { code } = await applyBabelPlugins({
|
|
59
64
|
babelPlugins: [
|
|
60
65
|
[babelPluginRewriteImportMetaCssAssignment, { relativeUrl }],
|