@jsenv/plugin-commonjs 2.2.0 → 2.3.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/package.json
CHANGED
|
@@ -4,12 +4,14 @@ import { defaultLookupPackageScope } from "@jsenv/node-esm-resolution";
|
|
|
4
4
|
|
|
5
5
|
import { commonJsToJsModule } from "./cjs_to_esm.js";
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const compileCacheDirectoryUrlDefault = new URL("../.cache/", import.meta.url);
|
|
8
8
|
|
|
9
9
|
export const jsenvPluginCommonJs = ({
|
|
10
10
|
name = "jsenv:commonjs",
|
|
11
11
|
logLevel,
|
|
12
12
|
include,
|
|
13
|
+
compileCacheDirectoryUrl = compileCacheDirectoryUrlDefault,
|
|
14
|
+
dev,
|
|
13
15
|
}) => {
|
|
14
16
|
const markAsJsModuleProxy = (reference) => {
|
|
15
17
|
reference.expectedType = "js_module";
|
|
@@ -77,7 +79,8 @@ export const jsenvPluginCommonJs = ({
|
|
|
77
79
|
compileCacheDirectoryUrl,
|
|
78
80
|
sourceFileUrl: commonJsUrlInfo.url,
|
|
79
81
|
browsers: !nodeRuntimeEnabled,
|
|
80
|
-
processEnvNodeEnv:
|
|
82
|
+
processEnvNodeEnv:
|
|
83
|
+
dev || urlInfo.context.dev ? "development" : "production",
|
|
81
84
|
...urlInfo.data.commonjs,
|
|
82
85
|
});
|
|
83
86
|
if (isValid) {
|