Do you want to request a feature or report a bug?
I wish to report a bug.
What is the current behavior?
When you run
const dirname = 'MyModule';
System.import(`./subdir/${dirname}`)
It resolves the file path to ./MyModule
and says the module cannot be found.
If the current behavior is a bug, please provide the steps to reproduce.
Here is a repository that reproduces this behavior. It also shows that the dynamic path resolution does work when subdirs and implicit index.js are not involved.
https://github.com/Swizec/webpack-bug-showcase/blob/dynamic-async-path-bug/src/index.js
What is the expected behavior?
Webpack loads ./subdir/MyModule/index.js
Please mention other relevant information such as the browser version, Node.js version, Operating System and programming language.
Webpack 2.2.0.rc.3
node 6.9.1
Chrome 55.0.2883.95 (stable)
Babel 6.12
Yes, and it works without the subpath.
Which leads me to believe it should work with paths more complex than
./
too.This works:
Output:
This does not work (without
+ '/index.js'
):