For the most part, you shouldn't have to change much when upgrading to Parcel 2:
¶ Code Changes
url: to the module specifier (read more about named pipelines in Plugin Configuration)
Alternatively, you can use a custom
.parcelrc to opt into the old behaviour (add more asset extensions if you use them):
Parcel 1 transpiled TypeScript using
tsc (the official TypeScript compiler). Parcel 2 instead uses Babel (using
@babel/preset-env) by default. This has two notable consequences:
(The TypeScript page contains more informations - and limitations - of Parcel's TypeScript handling.)
@babel/preset-typescript Isn't inserted Automatically into a Custom
For most use cases, transpiling using Babel is enough, so Parcel includes
@babel/preset-typescript in its default Babel config for TypeScript assets. You need to specify it manually however if you are using a custom
¶ Babel Doesn't Read
In case Babel doesn't work for you (e.g. because of an advanced
tsconfig.json), you can use
¶ Importing GraphQL
When import GraphQL files (
.gql), imports are still resolved/inlined (using
graphql-import-macro), but you now get the processed GraphQL query as a string instead of an Apollo AST.
package.jsons (e.g. the one generated by
npm init) contains
main: "index.js" which ignored by most tools (for non-library projects). Parcel 2 will however use that value as the output path (see Configuration#main),
for most web apps, this line should simply be removed.
This CLI flag is now inferred from your
package.json, one of these three properties is enough (number denotes priority).
Parcel 2 has scope hoisting enabled by default; to disable it, add
To bundle packages from
node_modules when targetting Node.js, you now should specify that in the target configuration:
--out-dir with the options in
package.json#targets, that option was renamed to
This flag, was removed and the path should instead be be specified in
package.json (see Configuration).
The log levels now have names instead of numbers (
This option has been removed without a replacement (for now).