Skip to content

Commit

Permalink
disable JSON wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
tido64 committed Jun 22, 2021
1 parent ef54802 commit e17a331
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/metro-transform-worker/src/index.js
Expand Up @@ -546,7 +546,10 @@ async function transformJSON(
file: JSONFile,
{options, config, projectRoot}: TransformationContext,
): Promise<TransformResponse> {
let code = JsFileWrapping.wrapJson(file.code, config.globalPrefix);
let code =
options.unstable_disableModuleWrapping === true
? JsFileWrapping.jsonToCommonJS(file.code)
: JsFileWrapping.wrapJson(file.code, config.globalPrefix);
let map = [];

// TODO: When we can reuse transformJS for JSON, we should not derive `minify` separately.
Expand Down

0 comments on commit e17a331

Please sign in to comment.