Migrating an Angular Project to Use Liferay npm Bundler 2.x
The Liferay npm bundler is deprecated of Liferay 2024.Q4/Portal GA129, and it’s planned for future removal.
Follow these steps to migrate your Angular project to use liferay-npm-bundler 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:
- 
Update the liferay-npm-bundlerdependency in yourpackage.jsonto version 2.x:{ "devDependencies": { ... "liferay-npm-bundler": "^2.0.0", ... }, ... }
- 
Remove all liferay-npm-bundler-preset-*dependencies from yourpackage.jsonbecause liferay-npm-bundler 2.x includes these by default.
- 
Remove any bundler presets you configured in your .npmbundlerrcfile. liferay-npm-bundler 2.x includes one smart preset that handles all frameworks automatically.
- 
Open your tsconfig.jsonfile and replace the"module": "amd"compiler option with the configuration shown below to produce CommonJS modules:{ "compilerOptions": { ... "module": "commonjs", ... } }
- 
Delete the .babelrcfile to remove the Babel configuration.
- 
Remove Babel from your package.jsonbuild process so it matches the configuration below:{ "scripts": { "build": "tsc && liferay-npm-bundler" }, ... }
- 
Remove the following Babel dependencies from your package.jsondevDependencies:"babel-cli": "6.26.0", "babel-preset-liferay-amd": "1.2.2"
Great! Your project is migrated to use liferay-npm-bundler 2.x.