Skip to content

Instantly share code, notes, and snippets.

@AlexanderOMara
Created December 5, 2017 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexanderOMara/09a9ca87e7fb7a0899b9854b7edce285 to your computer and use it in GitHub Desktop.
Save AlexanderOMara/09a9ca87e7fb7a0899b9854b7edce285 to your computer and use it in GitHub Desktop.
Webpack 4 Alpha ES Module Loader Issue
$ 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
import { something } from './other';
console.log(something());
export function something() {
return 'testing123';
}
{
"private": true,
"devDependencies": {
"webpack": "4.0.0-alpha.0"
}
}
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