-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Provide ES5 version for browser environment #13
Comments
We aim for Node.js, not the browser. You can find a more detailed explanation here sindresorhus/ama#446 |
I encourage you to open an issue on https://github.com/webpack/webpack/issues about including support for automatic transpiling of node_modules that need it. |
You don't need to open an issue there. Just don't exclude modules like this for babel-loader. |
Thanks for explanation and help guys. I decided to just add this module to the paths transformed by the babel-loader
|
@stevemao Yes, they do. I'm tired of getting issues like this on all my repos. It's better if Webpack resolved this. |
@sindresorhus Jup, that's why I have it as a saved reply ;) |
@sindresorhus I don't see how this fit in webpack either. const path = require('path')
const sindreModulePaths = require('sindre-module-paths')
// Then in some async function
const es6ModulePaths = await sindreModulePaths();
{
test: /\.js$/,
include: [
...es6ModulePaths,
path.resolve(__dirname, 'src'),
],
use: 'babel-loader',
} Let me know if you have any questions :) |
Can't we just detect if the engines field is set to Node.js 4+? Then we would have a general solution that works if the field is being used correctly. If it's not present, people can always add a PR. Sindre always uses it so that's covered. |
Yes, I've suggested that to both the Babel and Webpack maintainers. |
I'm not the only one targeting Node.js 4 these days, fwiw. |
This is such a typical front-end attitude. Instead of actually trying to fix the core problem, you independently create different layers of indirections that just works around part of the problem. |
@stevemao You know could have actually made a useful module if you checked the "engine" field instead. |
Hi @sindresorhus. Can you please provide ES5 version so it can work in older browsers that doesn't support arrow functions and other goodies. I use webpack and babel-loader in my project but I don't transpile any modules from node_modules directory:
So.. it would be to at least have a choice between ES5 and ES6 version. Thanks :)
The text was updated successfully, but these errors were encountered: