Can I use Angular 6 without Webpack?

I want to compile my angular 6 codes and pack them myself.

Can I use Angular 6 without Webpack?

And Does packing .html and .css into a .js WebPack's Job or Angular CLI's Job??

2 answers

  • answered 2018-07-11 06:09 Ali Rida

    Webpack is a JavaScript module bundler. Angular cli uses it to pack and build the Angular app.

    If you want to use Angular cli then you're stuck with Webpack for now.

    Otherwise if you create your own architecture to bundle and build your app (which is harder) then you can use other Javascript module bundlers such as Rollup and Browserify

  • answered 2018-07-11 06:14 Komal

    Webpack is a powerful module bundler. A bundle is a JavaScript file that incorporates assets that belong together and should be served to the client in a response to a single file request. A bundle can include JavaScript, CSS styles, HTML, and almost any other kind of file.

    Webpack roams over your application source code, looking for import statements, building a dependency graph, and emitting one or more bundles. With plugins and rules, Webpack can preprocess and minify different non-JavaScript files such as TypeScript, SASS, and LESS files.