When using the experimentalCodeSplitting and output.dir options - is it somehow possible to maintain the relative folder structure of the input files - or somehow direct the output of individual bundles relative to output.dir?
With this config:
export default {
input: [
'src/module1.js',
'src/foo/module2.js',
'src/foo/bar/module3.js',
],
experimentalCodeSplitting: true,
output: {
format: cjs,
dir: 'dist'
}
}
What I get is this flat structure:
dist/module1.js
dist/module2.js
dist/module3.js
but I'd like this:
dist/module1.js
dist/foo/module2.js
dist/foo/bar/module3.js
@maranomynet you can name the input files with:
export default {
input: {
'module1': 'src/module1.js',
'foo/module2': 'src/foo/module2.js',
'foo/bar/module3': 'src/foo/bar/module3.js',
},
experimentalCodeSplitting: true,
output: {
format: cjs,
dir: 'dist'
}
}
it could well be worthwhile to have an option for this - I've wondered if we need an inputNameBase or something like that, where the default can be false implying basenames only. Just have to be super careful with all this stuff to try and make it relatively intuitive.
Ah, wonderful! thank you.
But the documentation for the input option does not convey this information very clearly.
Not in a million years would I have guessed this was what it meant.
I'd rewrite it and make a pull request, but I feel like I don't understand this well enough to document it correctly.
well, I guess output.dir could also accept a inputFile->outputFile mapping function
Most helpful comment
well, I guess
output.dircould also accept a inputFile->outputFile mapping function