-
Notifications
You must be signed in to change notification settings - Fork 41
Migrate a plain Javascript project to bundler 2.x
⚠️ The contents of this wiki have been migrated to theliferay/liferay-frontend-projects
monorepo and more specifically to the to themaintenance/projects/js-toolkit/docs
directory. Development and updates will continue there, and this repo will be archived (ie. switched to read-only mode).
Javascript based projects usually rely on Babel to transpile source files as well as performing some transformation steps that were needed for the bundler 1.x
to produce a valid artifact (basically wrapping project's code into AMD modules).
With bundler 2.x
, you must keep using it to transpile but remove all the transformation steps that bundler 1.x
imposed on the project files, since bundler 2.x
already takes care of those steps for you.
To do that you must remove any Babel preset used for transformations from your project configuration by following these steps:
Modify: .babelrc
From:
{
"presets": ["es2015", "liferay-project"]
}
To:
{
"presets": ["es2015"]
}
Modify: package.json
From:
{
"devDependencies": {
...
"babel-preset-liferay-project": "1.6.0",
...
},
...
}
To:
{
"devDependencies": {
...
🚫 (removed line) 🚫
...
},
...
}