Closed dreampasssser closed 6 months ago
Hello @dreampasssser,
thanks for the issue report. I will fix it.
@webdiscus Well, I also found that the latest version of the Plugin is 3.4.4, but it is still at 3.1.3 in Github releases. There must be something wrong.
@dreampasssser
the missing pathData.filename
is a Webpack bug.
I can reproduce it w/o the plugin, just with minimal Webpack config:
const path = require('path');
module.exports = {
mode: 'production',
output: {
path: path.join(__dirname, 'dist/'),
filename: (pathData) => {
const { filename } = pathData;
console.log('-- JS.filename: ', {
filename, // => undefined
});
return '[name].bundle.js';
},
},
entry: {
main: './src/main.js', // => dist/main.bundle.js
},
};
But I have fixed the issue in the plugin. I just test it by me local.
@dreampasssser
the pathData.filename
is fixed in the version 3.4.5
.
Can you please check it in your project?
You can use the manual watch test to create a simple repo if you have any issue.
@webdiscus
Oh, you are so efficient. I checked it, it's OK. The pathData.filename
is back, but the pathData.chunk.name
is lost, it still existed in last version(3.4.4).
@dreampasssser
I'm sorry, the pathData.chunk.name
is in 3.4.6
fixed.
Thank you!
@webdiscus
That's all right!
Current behaviour
As the title says.
Expected behaviour
Js references are not lost in html and pathData.filename is not lost in function.
Reproduction Example
You can just use the example 'simple-site', in order to keep the folder structure, I wrote a function:
This can generate a new name, use it like this:
It works when npm run build and the 1st time npm run start, but when you modify a style in scss file, it will not work, the loss as title says will happen.
Environment
Additional context
None.