-
-
Save AlexanderOMara/09a9ca87e7fb7a0899b9854b7edce285 to your computer and use it in GitHub Desktop.
Webpack 4 Alpha ES Module Loader Issue
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
$ node --experimental-modules main.mjs | |
(node:50434) ExperimentalWarning: The ESM module loader is experimental. | |
testing123 | |
$ node_modules/.bin/webpack | |
(node:50364) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead | |
(node:50364) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead | |
(node:50364) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead | |
(node:50364) DeprecationWarning: The callback argument was splitted into resolveContext and callback. | |
Hash: a5d79fd2ff1bcf59c1ac | |
Version: webpack 4.0.0-alpha.0 | |
Time: 138ms | |
Asset Size Chunks Chunk Names | |
main.bundle.js 3.11 KiB main [emitted] main | |
[./main.mjs] 62 bytes {main} [built] | |
ERROR in ./main.mjs | |
Module not found: Error: Can't resolve './other' in '/path/to/webpack-4alpha-esm-issue' | |
@ ./main.mjs 1:0-34 3:12-21 |
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 { something } from './other'; | |
console.log(something()); |
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
export function something() { | |
return 'testing123'; | |
} |
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
{ | |
"private": true, | |
"devDependencies": { | |
"webpack": "4.0.0-alpha.0" | |
} | |
} |
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 = { | |
mode: 'development', | |
entry: './main.mjs', | |
output: { | |
filename: 'main.bundle.js' | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment