Closed ivancuric closed 6 years ago
Use an absolute path
Not working. If using an absolute path like fileName: path.join(__dirname, 'dist','manifest.json')
, it just gets appended to the output directory, eg:
./dist/Users/ivan/Dev/projectName/dist/manifest.json
Weird... We have one test that cover that: https://github.com/danethurber/webpack-manifest-plugin/blob/78c53210716e9c32c9b1d840ab5ce11b4750bbe1/spec/plugin.spec.js#L500-L522
Do you mind sending us a failing test so we can have a better look
Uh, never done tests before, but I can send you a reduced config:
The other manifest.json in /dist/
is from another build process, that needs to be concatenated to.
What's your version of webpack-manifest-plugin
?
"webpack-manifest-plugin": "^1.3.1",
My bad..., I managed to reproduce it, I will try to have a look tonight
So I find the reason why the tests are passing
The join
function of https://github.com/webpack/webpack/blob/master/lib/MemoryOutputFileSystem.js and https://github.com/webpack/webpack/blob/master/lib/node/NodeOutputFileSystem.js are behaving defferently
memoryFs.join('/dir1', '/dir2/file')
=> /dir2/file
path.join('/dir1', '/dir2/file')
=> /dir1/dir2/file
Uh... That's weird.
published v1.3.2
I have a use case where I'd like to output the manifest.json in a different folder than where the bundles are output.
However, if I want to output it in the parent directory, I have to use
fileName: '../manifest.json'
.This is not really maintainable cross-config.