Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

feat: support nested output paths #39

Closed
paulmichalak opened this issue Nov 5, 2014 · 9 comments
Closed

feat: support nested output paths #39

paulmichalak opened this issue Nov 5, 2014 · 9 comments

Comments

@paulmichalak
Copy link

I'm having an issue when dealing with multiple entry bundles. While I can specify the path for the css file output for each bundle all the fonts in my CSS are just dumped to the base output path.

@sokra
Copy link
Member

sokra commented Nov 20, 2014

Use output.path in addition to output.filename.

@paulmichalak
Copy link
Author

I'm hoping for multiple output paths (one for each entry bundle). So the output path is generic and then the filename for my javascript is [name]/[name].js. Similarly I'm trying to do new extractTextPlugin('[name]/css/styles.css') but the assets such as fonts associated with the css file are not put in the same path.

@anthonyhastings
Copy link

Hey,

Resurrecting an old ticket but I too am essentially wanting to have multiple output folders for my entry bundles. An example:

Bundle A and Bundle B get output into ./assets/js/
Bundle C gets output into ./another-folder/js

@Swivelgames
Copy link

Uh, yup. Just ran into the same dilemma. Bump 😃

@anthonyhastings
Copy link

Just an update to say that I've currently got around this issue by using webpack-stream, and not specifying any output options in the webpack configuration. I then use gulp-rename to update the paths of the streams based upon a manifest I keep that coincides with my webpack entry bundles, and that does the job. Slightly convoluted but it's a viable workaround!

@AsaAyers
Copy link

AsaAyers commented Dec 1, 2015

Same here. I have a webpack configuration that needs to output to 2 different folders. output.path is the base and output.filename contains [name]/.

I don't know what the implementation would involve, but it seems clear to me the right answer is either reuse output.filename, or allow us to specify a filename option that works the same way.

@brandonmp
Copy link

it's a little hackish, but the most simple solution for me was adding some shell commands to my npm scripts.

eg

"scripts": {
    "build": "webpack -p --colors --optimize-dedupe && cp ./path/to/index.html ./dist/index.html"
  }

@lcrespom
Copy link

lcrespom commented Jan 22, 2017

I am working on a small project and already stumbled with this limitation. In my case, I want some code in the dist/ folder and some other code in the web/ folder.

As a suggestion, this could be a way to specify it:

entry: {
    example: './src/examples/main.ts',
    'my-lib': './src/my-lib.ts'
},
output: {
    path: path.resolve(__dirname),
    filenames: {
        example: 'web/example.js',
        'my-lib': 'dist/my-lib.js'
    }
}

@brandonmp solution has a major drawback: it is not portable, because Windows won't recognize the "mv" command.

@red2678
Copy link

red2678 commented Mar 16, 2017

+1

@michael-ciniawsky michael-ciniawsky changed the title Multiple entry bundles / file output. feat: support nested output paths Apr 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests