Skip to content

Commit

Permalink
Fix web extension scope hoisting (#7985)
Browse files Browse the repository at this point in the history
  • Loading branch information
101arrowz committed Apr 21, 2022
1 parent 4700f42 commit 9b7a5d2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/transformers/webextension/src/WebExtensionTransformer.js
Expand Up @@ -353,13 +353,20 @@ export default (new Transformer({
// browsers, and because it avoids delegating extra config to the user
asset.setEnvironment({
context: 'browser',
engines: asset.env.engines,
shouldOptimize: asset.env.shouldOptimize,
sourceMap: {
engines: {
browsers: asset.env.engines.browsers,
},
sourceMap: asset.env.sourceMap && {
...asset.env.sourceMap,
inline: true,
inlineSources: true,
},
includeNodeModules: asset.env.includeNodeModules,
outputFormat: asset.env.outputFormat,
sourceType: asset.env.sourceType,
isLibrary: asset.env.isLibrary,
shouldOptimize: asset.env.shouldOptimize,
shouldScopeHoist: asset.env.shouldScopeHoist,
});
const code = await asset.getCode();
const parsed = parse(code);
Expand Down

0 comments on commit 9b7a5d2

Please sign in to comment.