I have my webpack config as below
entry : {
lib: "./path/to/index",
sublib: "./path/to/sub/index"
},
output : {
filename: "[name]/[name].lib.js",
path: __dirname + "/dist",
}
It currently building in below folder structure
- src
|
|- /dist
|-- lib/lib.lib.js
|-- sublib/sublib.lib.js
But what I want is both should build in same folder i.e., lib like below
- src
|
|- /dist
|-- lib/lib.lib.js
|---- lib.lib.js
|---- sublib.lib.js
And I don't want to make two different webpack config & I don't even want to merge my class in single export file because I want them in be separate.
Any Idea how I can achieve this I am using webpack 4. Any help will be appreciated.
I figured out a workaround for it here what worked for me While giving library name in entry object just make your
sublibunderlib. your entry object should look like belowso this will export your
sublibinlibfolder. this will be very helpful when have written a Jenkins jobs to pic library fromlibfolder to publish in yournpmrepo