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

If you require require, the globalize replacement won't work. #39

Open
jpnelson opened this issue Mar 7, 2016 · 0 comments
Open

If you require require, the globalize replacement won't work. #39

jpnelson opened this issue Mar 7, 2016 · 0 comments

Comments

@jpnelson
Copy link
Collaborator

jpnelson commented Mar 7, 2016

If you do:

define(["require", "./beautify", "./beautify-css"], function(requireamd) {
            var js_beautify = requireamd("./beautify");
            var css_beautify = requireamd("./beautify-css");

(source: https://github.com/beautify-web/js-beautify/blob/master/js/lib/beautify-html.js )

then

data = data.replace('require("' + imp.value + '")', replaceWith);
data = data.replace('require(\'' + imp.value + '\')', replaceWith);

(source: https://github.com/treshugart/galvatron/blob/master/src/globalize.js#L121 )
won't work, as it requires with an alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant