Conversation
`globalOptions` is useful when a babel plugin needs non-serializable options (such as functions, callbacks), thus it's worth mentioning in the README.
| @@ -1,6 +1,6 @@ | |||
| # babel-loader | |||
| [](https://www.npmjs.com/package/babel-loader) | |||
| [](https://travis-ci.org/babel/babel-loader) | |||
There was a problem hiding this comment.
My editor automatically deletes trailing spaces, but I guess that's desirable for everyone so I'm keeping that change.
|
global options is not supported as of webpack 2, so I would not add it to the documentation anymore. module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
}
]
} |
|
@danez As I've mentioned:
For example, I have some babel plugins to collect (and not transform) occurrences of a particular expression type in all of my javascript files and process collected expressions. One of those plugins collect Tricky part is how to send collected expressions to the outside world. For that, I pass a function callback as an option to the babel plugin. The only way of achieving that using For Webpack2, I'm hoping that |
|
For webpack2 the The Readme for babel-loader is for both webpack 1 & 2 right now, but we want to release a new major version soon for webpack 2 only. |
|
Could you add a note that this form of defining options is deprecated in webpack2 and one should use |
Codecov Report
@@ Coverage Diff @@
## master #365 +/- ##
=======================================
Coverage 80.92% 80.92%
=======================================
Files 6 6
Lines 152 152
Branches 33 33
=======================================
Hits 123 123
Misses 13 13
Partials 16 16Continue to review full report at Codecov.
|
|
Thank you, I added the note about webpack 2. |
Fixes #364
globalOptionsis useful when a babel plugin needs non-serializable options (such as functions, callbacks), thus it's worth mentioning in the README.What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)