GithubHelp home page GithubHelp logo

Comments (9)

sokra avatar sokra commented on July 28, 2024

Use output.path in addition to output.filename.

from extract-text-webpack-plugin.

paulmichalak avatar paulmichalak commented on July 28, 2024

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.

from extract-text-webpack-plugin.

anthonyhastings avatar anthonyhastings commented on July 28, 2024

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

from extract-text-webpack-plugin.

Swivelgames avatar Swivelgames commented on July 28, 2024

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

from extract-text-webpack-plugin.

anthonyhastings avatar anthonyhastings commented on July 28, 2024

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!

from extract-text-webpack-plugin.

AsaAyers avatar AsaAyers commented on July 28, 2024

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.

from extract-text-webpack-plugin.

brandonmp avatar brandonmp commented on July 28, 2024

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"
  }

from extract-text-webpack-plugin.

lcrespom avatar lcrespom commented on July 28, 2024

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.

from extract-text-webpack-plugin.

red2678 avatar red2678 commented on July 28, 2024

+1

from extract-text-webpack-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.