-
Notifications
You must be signed in to change notification settings - Fork 82
Conversation
Since webpack v2, it's better to use ES modules. Note that this is incompatible with webpack v1, so it should be released as a major version.
LGTM |
`npm install --save json-loader` | ||
|
||
For webpack v1 users: | ||
|
||
`npm install --save [email protected]` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will work in webpack 1:
const esModuleLoaderConfig = 'babel-loader?'JSON.stringify({
babelrc: false,
plugins: ['transform-es2015-modules-commonjs', 'add-module-exports'],
});
export default {
loaders: { test: /\.json$/, loader: `{$esModuleLoaderConfig}!json-loader` },
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would in theory work. But it would be much easier to just use 0.5.4
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's stop this PR for now, as this is a breakage for all CommonJS users. Even webpack 2.
The current code seems to do |
Yep save to close 👍 Thx |
Since webpack v2, it's better to use ES modules. Note that this is incompatible with webpack v1, so it should be released as a major version.
Fixes #15.