Last active
June 22, 2019 06:00
-
-
Save anandthakker/40464d1e684ba5857e12c87821bb3664 to your computer and use it in GitHub Desktop.
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
const dm = require('deepmerge'); | |
if (typeof dm !== 'function') { | |
throw new Error("require('deepmerge') is not a function"); | |
} | |
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
import dm from 'deepmerge'; | |
if (typeof dm !== 'function') { | |
throw new Error("require('deepmerge') is not a function"); | |
} | |
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
{ | |
"name": "webpack-cjs-issue", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"dependencies": { | |
"deepmerge": "^2.1.0", | |
"webpack": "^4.5.0" | |
}, | |
"devDependencies": { | |
"webpack-cli": "^2.0.14" | |
}, | |
"scripts": { | |
"test-webpack": "webpack && node dist/bundle.js", | |
"test-node-cjs": "node index.js", | |
"test-node-esm": "node --experimental-modules index.mjs" | |
} | |
} |
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
module.exports = { | |
entry: './index.js', | |
output: { | |
filename: 'bundle.js' | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment