Closed
Description
Do you want to request a feature or report a bug?
bug
What is the current behavior?
I used comment to define chunkname as follows:
import(/* webpackChunkName: "chunk1" */'@/components/chunk1.js')
But in build report there is no chunk name specified and still generate filename as 1.[hash].js
If the current behavior is a bug, please provide the steps to reproduce.
https://github.com/MarvinXu/webpack-chunkname-test
npm install
npm run build
Activity
stevewillard commentedon May 12, 2017
Try with an '='
MarvinXu commentedon May 12, 2017
doesn't work.
maelon commentedon May 15, 2017
Same problem.
I had to use webpack 1. The old api
require.ensure
works perfectly in webpack 1.MarvinXu commentedon May 15, 2017
To be clear, I use the latest webpack(2.5.1) in my project. The
require.ensure
method works fine with the chunkname, it's just comment definition inimport()
doesn't work. I don't know where went wrong.I added
require.ensure
test in my project:https://github.com/MarvinXu/webpack-chunkname-test
ematipico commentedon May 15, 2017
I use this feature (2.5.1) and it works fine to me. The only difference is that I don't have the '@' inside the path of my dynamic module; instead I have a relative path.
MarvinXu commentedon May 15, 2017
@ematipico '@' is an alias for 'src', I've tested it is not relevant to this.
maelon commentedon May 15, 2017
I also set an alias for path, so it fails here?
a573367014 commentedon May 24, 2017
I have the same problem
quantizor commentedon May 24, 2017
It works for me without the
@
- might be something with your setup. (I'm on OS X, for reference.)silen-z commentedon May 26, 2017
I've encountered this and it turned out I had to set output.chunkFilename in my webpack config
MarvinXu commentedon Jun 1, 2017
@probablyup
Did you test on my project? I removed alias '@' just now. Can you test it for me once more?
6220119 commentedon Jun 9, 2017
This is not related to Webpack as @MarvinXu is using
vue-cli
withwebpack
template to generate the project. This issue should be closeddevinRex commentedon Aug 16, 2017
Same problem. Does someone find the solution?
28 remaining items