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

Would like to use my own polyfills with Webpack 'node' option #55

Open
ORESoftware opened this issue Apr 5, 2017 · 4 comments
Open

Comments

@ORESoftware
Copy link

I am looking to use my own polyfills/shims with Webpack

e.g.:

//webpack.config.js

node: {
 assert: require.resolve('oresoftware-assert'),
 fs: require.resolve('oresoftware-fs')
}

is this already supported? I don't believe I have seen this documented, but it would be a great feature, please advise

@ORESoftware
Copy link
Author

I tried it, and I get an error:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.node['assert'] should be one of these:
   false | true | "mock" | "empty"

this is an important feature, that I really need, thanks!

@ORESoftware ORESoftware changed the title Would like to use my own polyfill Would like to use my own polyfills with Webpack 'node' option Apr 5, 2017
@ORESoftware
Copy link
Author

@sokra would you accept a PR for this?

@jhnns
Copy link
Member

jhnns commented Apr 6, 2017

It should be possible to use resolve.alias to use your own shims.

@ORESoftware
Copy link
Author

@jhnns thanks, not as far as I can tell -

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.node['assert'] should be one of these:
   false | true | "mock" | "empty"

If I try to pass my own value, it won't take. The value I pass needs to be one of false | true | 'mock' | 'empty'

I need Webpack to be able to accept a dynamic value. Is that clear?

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

2 participants