-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How to preserve the src/ directory structure when building to dist/ directory? #49
Comments
You can control the structure of the /dist directory with the webpack.config.js file, because it's Webpack that bundles the different files into ES modules (ESM). You can have multiple entries in the module.exports, and for each of them have a different filename and output path, as you specify it yourself. You can use the GlobEntries if you want to have multiple files from the same directory bundled without specifying them one by one. You can use the CopyPlugin to simply copy files that don't need to be transformed. A webpack.config.js for this specific example should look something like this:
|
Thank you |
Could you please clarify how to achieve the same directory structure in the dist/ as in the src/. None of the responses from here https://stackoverflow.com/questions/52121725/maintain-src-folder-structure-when-building-to-dist-folder-with-typescript-3 helped.
Thanks in advance
The text was updated successfully, but these errors were encountered: