Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix global meta option not working when transpiled #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/global_amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ module.exports = function(load){
" });\n" +
" var define = loader.global.define;\n" +
" var require = loader.global.require;\n" +
" var source = \"" + source + "\";\n" +
" var source = \"" + (metadata.exports ? (source + 'this[\'' + metadata.exports + '\'] = ' + metadata.exports) : source) + "\";\n" +
(metadata.init ? " var init = " + metadata.init.toString() + ";\n" : "") +
" loader.global.define = undefined;\n" +
" loader.global.module = undefined;\n" +
" loader.global.exports = undefined;\n" +
" loader.__exec({'source': source, 'address': module.uri});\n" +
" loader.__exec({'source': source, 'address': module.uri, 'metadata': {'eval': '" + (metadata.eval || '') + "'} });\n" +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failing because this changes the output. Would be better to only add this bit if metadata.eval is truthy.

" loader.global.require = require;\n" +
" loader.global.define = define;\n" +
"\n return loader.get(\"@@global-helpers\").retrieveGlobal(module.id, " +
Expand Down