Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
Active le scope hoisting / tree shaking de Parcel V2
Browse files Browse the repository at this point in the history
- Parcel 1.12.5 avec scope hoisting
    - `index.html` 169K
    - `style.88e06b34.css` 36K
    - `main.27939ae7.js` 264K
    - `service-worker.js` 4,2K

- Parcel 2.0.1 sans scope hoisting
    - `index.html` 168K
    - `index.48dec129.css` 36K
    - `index.06fd10a8.js` 436K
    - `service-worker.js` 71K

- Parcel 2.0.1 avec scope hoisting
    - `index.html` 168K
    - `index.48dec129.css` 36K
    - `index.5c7628de.js` 240K → version module
    - `index.696647a3.js` 282K → version nomodule
    - `service-worker.js` 36K

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
ronnix committed Mar 3, 2022
1 parent 58c58da commit fa3037a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"test-integration": "mocha --color --require @babel/register --bail --timeout 0 src/scripts/tests/integration/",
"test-integration:ci": "mocha --color --require @babel/register --bail --timeout 15000 --retries=5 src/scripts/tests/integration/",
"lint": "eslint --color src/scripts/ src/service-worker.js",
"build": "parcel build --no-scope-hoist src/index.html src/*.html --detailed-report 20",
"build": "parcel build src/index.html src/*.html --detailed-report 20",
"build-dev": "parcel src/*.html --log-level info --open"
},
"parcelIgnore": [
Expand Down

0 comments on commit fa3037a

Please sign in to comment.