Setting up Angular with webpack

Armed with knowledge of webpack's core concepts and how to add extra capabilities, we should now feel ready to take on bootstrapping an Angular project. First off, create the following files:

  • webpack: When setting up webpack, it's usually a good idea to set up your config to consist of the following three files:
    • webpack.common.js: This is where most of the configuration will happen
    • webpack.dev.js: This is the dev environment-specific configuration
    • webpack.prod.js: This is the prod environment-specific configuration
  • package.json: This file will list what libraries we are dependent on for Angular to be properly bootstrapped. This is listed in devDependencies and depedencies. We will also list some commands in the script that allow us to fire up the application, so it can be run on a web server. We will furthermore create commands for testing and a command for creating a production bundle.
  • tsconfig.json: This file is meant for the TypeScript compiler. It is worth noting that we want to enable certain functionalities for the app to work, such as emitDecoratorMetadata and experimentalDecorators.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset