Skip to content

Different approach to require to avoid webpack bundling#10

Merged
garyb merged 1 commit into
masterfrom
no-webpack-require
May 10, 2016
Merged

Different approach to require to avoid webpack bundling#10
garyb merged 1 commit into
masterfrom
no-webpack-require

Conversation

@garyb

@garyb garyb commented May 10, 2016

Copy link
Copy Markdown
Owner

This actually resolve #6 at last. Going via module.require worked in Affjax, so I've taken the same approach here.

@hdgarrood @jplatte do you know if there's a reason why we can't use module.require instead of require? Going via module should still work in node 6, should it not?

@garyb

garyb commented May 10, 2016

Copy link
Copy Markdown
Owner Author

/cc @hdgarrood not sure if you'll get the ping above because I misspelled your name yet again before editing the correct speeelng in.

@jplatte

jplatte commented May 10, 2016

Copy link
Copy Markdown
Contributor

I don't even know the difference. I just used require because that's what the example in the node documentation used. module.require does work on node 6.

@garyb

garyb commented May 10, 2016

Copy link
Copy Markdown
Owner Author

Ok, thanks for testing! This should be fine then I think.

@garyb

garyb commented May 10, 2016

Copy link
Copy Markdown
Owner Author

@jplatte There's nothing wrong with require usually, by the way. I'm attempting to intentionally prevent tools like Browserify and Webpack from treating it the way they're designed to do so in this case, as we don't want to bundle the node library code when in the browser.

@hdgarrood

Copy link
Copy Markdown

Looks sensible enough to me.

@garyb garyb merged commit e332443 into master May 10, 2016
@garyb garyb deleted the no-webpack-require branch May 10, 2016 19:54
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

Successfully merging this pull request may close these issues.

Dynamic require makes build tools complain

3 participants