This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/parcel-bundler/parcel/releases/tag/v2.5.0 https://www.npmjs.com/package/parcel/v/2.5.0 == Notes de migration == - Par défaut, Parcel v2 utilise swc au lieu de Babel pour la transpilation Avantage : c’est plus rapide. Par contre, l’utilisation des tagged template litterals conduit à la génération de code qui déclenche une erreur dans terser (le minifieur) : parcel-bundler/parcel#7101 On contourne le problème en écrivant différemment notre code pour échapper le nom du profil dans le HTML généré dynamiquement. - Depuis la 2.4.0, Parcel utilise @parcel/css au lieu de PostCSS (cf. https://parceljs.org/blog/v2-4-0/) - On met à jour les anciens plugins (changement d’API) : - on remplace le plugin [parcel-plugin-static-files-copy](https://www.npmjs.com/package/parcel-plugin-static-files-copy) par [parcel-reporter-static-files-copy](https://www.npmjs.com/package/parcel-reporter-static-files-copy) - on remplace [parcel-plugin-ogimage](https://www.npmjs.com/package/parcel-plugin-ogimage) par [parcel-optimizer-ogimage](https://www.npmjs.com/package/parcel-optimizer-ogimage) - on remplace [parcel-plugin-html-externals](https://www.npmjs.com/package/parcel-plugin-html-externals) par [parcel-resolver-ignore](https://www.npmjs.com/package/parcel-resolver-ignore) - on active le plugin standard `@parcel/resolver-glob` pour utiliser des imports `*` comme dans Parcel V1. - on remplace le plugin [parcel-plugin-sw-asset-urls](https://www.npmjs.com/package/parcel-plugin-sw-asset-urls) par le plugin standard `@parcel/service-worker` (ce qui évite de devoir maintenir à la main la liste de fichiers à mettre en cache) - On s’assure que les noms des bundles soient mcc.XXX.(css|js) Les règles de nommage par défaut de Parcel utilisent l’arbre d’import pour déterminer quel est le nom du fichier racine : https://github.com/parcel-bundler/parcel/blob/v2/packages/namers/default/src/DefaultNamer.js Cela donne des noms un peu arbitraires pour les bundles CSS et JS. On utilise le plugin `parcel-namer-rewrite` pour forcer un nom plus explicite : https://www.npmjs.com/package/parcel-namer-rewrite - On normalise les liens dans les fichiers sources : - lien absolu "/" pour aller vers la page d’accueil - lien relatif "toto.html" pour aller vers une autre page Note: des liens absolus seront bien générés par Parcel au final. - On ajoute un lien vers le fichier `browserconfig.xml` - On note que deux versions du JS sont générées : - une pour les navigateurs modernes capables de charger un script de type "module" - une option de repli pour les navigateurs plus anciens cf. https://parceljs.org/features/targets/#differential-bundling
- Loading branch information
Showing
26 changed files
with
8,191 additions
and
8,596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
"@parcel/babel-preset-env", | ||
{ | ||
"corejs": 3, | ||
"useBuiltIns": "usage" | ||
} | ||
] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ cert.pem | |
node_modules/ | ||
.cache | ||
.nyc_output | ||
.parcel-cache | ||
__pycache__ | ||
.tox | ||
*.egg-info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"extends": "@parcel/config-default", | ||
"namers": [ | ||
"parcel-namer-rewrite" | ||
], | ||
"resolvers": [ | ||
"@parcel/resolver-glob", | ||
"parcel-resolver-ignore", | ||
"..." | ||
], | ||
"transformers": { | ||
"*.{js,ts}": [ | ||
"@parcel/transformer-js" | ||
] | ||
}, | ||
"optimizers": { | ||
"*.html": [ | ||
"parcel-optimizer-ogimage", | ||
"..." | ||
] | ||
}, | ||
"reporters": [ | ||
"...", | ||
"parcel-reporter-static-files-copy" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.