Migrating an Angular Project to Use Bundler 2.x

After following the steps covered in the intro to this section, follow these remaining steps to migrate your Angular project to 2.x. While liferay-npm-bundler 1.x relied on Babel to perform some transformation steps, these transformations are now automatically applied in version 2.x. Therefore, you should remove Babel from your project:

  1. Open your tsconfig.json file and replace the "module": "amd" compiler option with the configuration shown below to produce CommonJS modules:

    {
      "compilerOptions": {
        ...
        "module": "commonjs",
        ...
      }
    }
    
  2. Delete the .babelrc file to remove the Babel configuration.

  3. Remove Babel from your package.json build process so it matches the configuration below:

    {
      "scripts": {
        "build": "tsc && liferay-npm-bundler"
      },
      ...
    }
    
  4. Remove the following Babel dependencies from your package.json devDependencies:

    "babel-cli": "6.26.0",
    "babel-preset-liferay-amd": "1.2.2"
    

Great! Your project is migrated to use the new version of the liferay-npm-bundler.

« Migrating a Plain JavaScript, Billboard JS, JQuery, Metal JS, React, or Vue JS Project to Use Bundler 2.xMigrating Your Project to Use liferay-npm-bundler's New Mode »
Was this article helpful?
0 out of 0 found this helpful