-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
12 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
import resolve from 'rollup-plugin-node-resolve' | ||
import commonjs from 'rollup-plugin-commonjs' | ||
|
||
var pkg = require('./package.json') | ||
const pkg = require(`./package.json`) | ||
|
||
export default { | ||
input: 'index.js', | ||
name: 'deepmerge', | ||
input: `index.js`, | ||
name: `deepmerge`, | ||
plugins: [ | ||
commonjs(), | ||
resolve(), | ||
], | ||
output: [ | ||
{ file: pkg.main, format: 'umd' }, | ||
{ file: pkg.module, format: 'es' }, | ||
{ file: pkg.main, format: `umd` }, | ||
], | ||
} |
c63a55f
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.
@TehShrike The root of problems here is default export. I found it's quite useless (and as you can see painful) and do not use for a year. All similar problems are go away. Would you like to simply got rid from default and provide named exports instead? Like this
c63a55f
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.
That would be a breaking change, and I think it would make the module less ergonomic for CommonJS consumers.
I'm just going to leave things as they are until Webpack eventually fixes this bug maybe someday.
c63a55f
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.
Actually there are two problems. 1. with webpack shitty interop, 2. with typescript which did not enabled esModuleInterop by default in recent major release.
I don't think webpack will ever fix it. Actually the best solution is disabling
module
field on user side. A lot of projects are broken if consumers uses commonjs. It's their problem and they should configure their project properly.So there's no good reason to stuck with commonjs, nobody gonna fix it.