Migrating a Plain JavaScript, Billboard JS, JQuery, Metal JS, React, or Vue JS Project to Use Liferay npm Bundler 2.x
Follow these steps to migrate the framework projects shown below to use liferay-npm-bundler 2.x:
- plain JavaScript project
- Billboard.js project
- JQuery project
- Metal.js project
- React project
- Vue.js project
While Babel is required to transpile your source files, you must remove any Babel preset used for transformations from your project that bundler 1.x imposed. liferay-npm-bundler 2.x handles these transformations by default:
-
Update the
liferay-npm-bundler
dependency in yourpackage.json
to version 2.x:{ "devDependencies": { ... "liferay-npm-bundler": "^2.0.0", ... }, ... }
-
Remove all
liferay-npm-bundler-preset-*
dependencies from yourpackage.json
because liferay-npm-bundler 2.x includes these by default. -
Remove any bundler presets you configured in your
.npmbundlerrc
file. liferay-npm-bundler 2.x includes one smart preset that handles all frameworks automatically. -
Remove the liferay-project preset from your project’s
.babelrc
file. All that should remain is thees2015
preset shown below:{ "presets": ["es2015"] }
If your project uses React, make sure the
react
preset remains as well:{ "presets": ["es2015", "react"] }
-
Remove the
babel-preset-liferay-project
dependency from yourpackage.json
.
Awesome! Your project is migrated to use liferay-npm-bundler 2.x.