question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The need for multiple output paths?

See original GitHub issue

I have the following use case, I am using React and along with that I have certain CSS files as dependencies. I have the following distribution folder tree:

-- dist/
    --js/
    --css/
    --media/

Since, now I would like to include CSS into the build system, but now since I have my output path in the webpack.config.js to ./dist/js, so even my CSS files are being generated there.

I think it is important to have multiple output paths. If not, could anybody suggest me any other workflow?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:82
  • Comments:79 (4 by maintainers)

github_iconTop GitHub Comments

822reactions
sashlesscommented, Nov 13, 2015

The example from @sokra wasnt exactly clear to me as well but it led me to a solution 👍

It works like this @matthewmueller @activatedgeek

We assume webpack.config.js is in the root directory of your project.

entry: {
  'build/application/bundle': './src/application', // will be  ./build/application/bundle.js,
  'build/library/bundle': './src/library`'// will be  ./build/library/bundle.js
},
output: {
  path: './',
  filename: '[name].js'
}
321reactions
sokracommented, Jun 24, 2015
output: {
  path: path.resolve(__dirname, "./dist"),
  filename: "js/bundle.js"
},
... "css/bundle.css"
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create multiple output paths in Webpack config
Webpack does support multiple output paths. Set the output paths as the entry key. And use the name as output template. webpack config:...
Read more >
06 - Create multiple output paths in Webpack - YouTube
In this series for Webpack, I'll show you the basics and how to use it, hopefully, it's useful for ...
Read more >
Set multiple outputs in Webpack - Medium
By default, webpack has a multiple input → single output policy but there are moments when we really need to have — let's...
Read more >
Multiple Output Paths – IDEs Support (IntelliJ Platform)
Hi,Will IDEA 4 support multiple output paths? This is very usefull option ... Or will I have to define a new module for...
Read more >
Output | webpack
Configuring the output configuration options tells webpack how to write the compiled files to disk. Note that, while there can be multiple entry...
Read more >

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found