Giter Club home page Giter Club logo

Comments (7)

jcoutch avatar jcoutch commented on August 26, 2024 9

Couldn't you just add the extraWebpackConfig option to your options array in angular.json for your various builds?

"architect": {
  "build": {
    "builder": "ngx-build-plus:build",
    "options": {
      "outputPath": "dist",
      ...
      "extraWebpackConfig": "webpack.extra.js"
    }
  }
}

I have it defined for both "build" and "serve", and ng build/ng serve pull in the extra webpack config as expected.

from ngx-build-plus.

manfredsteyer avatar manfredsteyer commented on August 26, 2024 1

Thanks for this feedback. Currently, I don't have such a plan. IMHO it's also possible that one wants different webpack.config files for different tasks (e. g. build and serve).

from ngx-build-plus.

euangoddard avatar euangoddard commented on August 26, 2024

Fair enough. I think both use-cases make sense, but I understand your position. Many thanks for getting back!

from ngx-build-plus.

 avatar commented on August 26, 2024

I think this should be re-opened. The point of Angular.json is to configure the project, which includes configuring webpack. The point of ngx-build-plus is to allow us to configure webpack more granularly. Such granular configuration is generally pretty fundamental, so it would be advantageous to define it as part of the core configuration rather than as an option (i.e. a flag than can easily be accidentally left out).

from ngx-build-plus.

KevinKelchen avatar KevinKelchen commented on August 26, 2024

That's awesome, @jcoutch!

I have a desire similar to the OP. I'm pretty new to Angular CLI configuration, but if this is a valid technique then I think that solves it, @manfredsteyer!

from ngx-build-plus.

benwinding avatar benwinding commented on August 26, 2024

Thanks @jcoutch,
I didn't realise it needed to be in both build and serve.
Cheers,
Ben

from ngx-build-plus.

kylecordes avatar kylecordes commented on August 26, 2024

BTW, the other tool for customizing webpack configs under Angular CLI:

https://github.com/just-jeb/angular-builders/tree/master/packages/custom-webpack

takes the approach described above: an entry in angular.json to point to the extra webpack config.

(There are many other differences of course, but this one seems like it should be adopted from there over to here.)

from ngx-build-plus.

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.