@jsenv/core 27.0.0-alpha.2 → 27.0.0-alpha.3
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/package.json
CHANGED
|
@@ -32,21 +32,31 @@ export const jsenvPluginImportMetaScenarios = () => {
|
|
|
32
32
|
}
|
|
33
33
|
if (scenario === "dev") {
|
|
34
34
|
dev.forEach((path) => {
|
|
35
|
-
replace(path, true)
|
|
35
|
+
replace(path, "true")
|
|
36
36
|
})
|
|
37
37
|
} else if (scenario === "test") {
|
|
38
|
+
// test is also considered a dev environment
|
|
39
|
+
// just like the dev server can be used to debug test files
|
|
40
|
+
// without this people would have to write
|
|
41
|
+
// if (import.meta.dev || import.meta.test) or if (!import.meta.build)
|
|
42
|
+
dev.forEach((path) => {
|
|
43
|
+
replace(path, "true")
|
|
44
|
+
})
|
|
38
45
|
test.forEach((path) => {
|
|
39
|
-
replace(path, true)
|
|
46
|
+
replace(path, "true")
|
|
40
47
|
})
|
|
41
48
|
} else if (scenario === "build") {
|
|
49
|
+
// replacing by undefined might not be required
|
|
50
|
+
// as I suppose rollup would consider them as undefined
|
|
51
|
+
// but let's make it explicit to ensure code is properly tree-shaked
|
|
42
52
|
dev.forEach((path) => {
|
|
43
|
-
replace(path, undefined)
|
|
53
|
+
replace(path, "undefined")
|
|
44
54
|
})
|
|
45
55
|
test.forEach((path) => {
|
|
46
|
-
replace(path, undefined)
|
|
56
|
+
replace(path, "undefined")
|
|
47
57
|
})
|
|
48
58
|
build.forEach((path) => {
|
|
49
|
-
replace(path, true)
|
|
59
|
+
replace(path, "true")
|
|
50
60
|
})
|
|
51
61
|
}
|
|
52
62
|
const magicSource = createMagicSource(content)
|