Skip to content

Instantly share code, notes, and snippets.

@jeluard
Created December 1, 2022 08:53
Show Gist options
  • Save jeluard/c6698fb0db88807ad548644a6ff8a209 to your computer and use it in GitHub Desktop.
Save jeluard/c6698fb0db88807ad548644a6ff8a209 to your computer and use it in GitHub Desktop.
Parcel tree-shaking
yarn run v1.22.19
$ rm -rf .parcel-cache dist node_modules yarn.lock
✨ Done in 2.52s.
yarn install v1.22.19
info No lockfile found.
[1/4] πŸ” Resolving packages...
warning parcel > @parcel/config-default > @parcel/optimizer-htmlnano > svgo > stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
[2/4] 🚚 Fetching packages...
[3/4] πŸ”— Linking dependencies...
warning " > react-iconly@2.2.5" has incorrect peer dependency "react@^16.8.6 || ^17".
[4/4] πŸ”¨ Building fresh packages...
success Saved lockfile.
✨ Done in 41.12s.
yarn run v1.22.19
$ parcel build ./src/index.html --no-scope-hoist --log-level verbose --public-url https://jeluard.github.io/swipealot/
@parcel/core: Target "app"
Entry: src/index.html
Output: dist/index.html
Format: global (default)
Context: browser (default)
Engines: last 2 versions
Library Mode: false (default)
Include Node Modules: true (default)
Optimize: true (default)
/Users/julien/Documents/Projects/jeluard/swipealot/package.json:11:10
10 | },
> 11 | "app": "dist/index.html",
> | ^^^^^^^^^^^^^^^^^ output defined here
12 | "targets": {
13 | "app": {}
14 | },
15 | "source": "src/index.tsx",
> 16 | "browserslist": [
> | ^
> 17 | "last 2 versions"
> | ^^^^^^^^^^^^^^^^^^^^^
> 18 | ],
> | ^^^ engines defined here
19 | "dependencies": {
20 | "@nextui-org/react": "1.0.0-beta.10",
@parcel/transformer-js: Conditional or non-top-level `require()` call. This causes the resolved module and all dependencies to be wrapped.
/Users/julien/Documents/Projects/jeluard/swipealot/src/index.tsx:1:1
> 1 | import React, { useEffect, useState } from "react";
> | ^
2 | import * as ReactDOMClient from 'react-dom/client';
3 | import { Heart as HeartIcon, CloseSquare as CloseSquareIcon } from 'react-iconly';
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#avoid-conditional-require()
@parcel/transformer-js: Non-static access of an `import` or `require`. This causes tree shaking to be disabled for the resolved module.
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/framer-motion/dist/es/utils/process.mjs:5:20
4 | const defaultEnvironment = "production";
> 5 | const env = typeof process === "undefined" || process.env === undefined
> | ^^^^^^^
6 | ? defaultEnvironment
7 | : process.env.NODE_ENV || defaultEnvironment;
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#dynamic-member-accesses
Installing process...
@parcel/resolver-default: Auto installing polyfill for Node builtin module "process"...
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/framer-motion/dist/es/utils/process.mjs:5:20
4 | const defaultEnvironment = "production";
> 5 | const env = typeof process === "undefined" || process.env === undefined
> | ^^^^^^^ used here
6 | ? defaultEnvironment
7 | : process.env.NODE_ENV || defaultEnvironment;
πŸ“ Learn more: https://parceljs.org/features/node-emulation/#polyfilling-%26-excluding-builtin-node-modules
yarn: [1/4] Resolving packages
@parcel/resolver-default: Auto installing polyfill for Node builtin module "buffer"...
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/@polkadot/util/has.js:14:33
13 | /** true if the environment has support for Buffer */
> 14 | export const hasBuffer = typeof Buffer !== 'undefined';
> | ^^^^^^ used here
15 |
16 | /** true if the environment is CJS */
πŸ“ Learn more: https://parceljs.org/features/node-emulation/#polyfilling-%26-excluding-builtin-node-modules
@parcel/transformer-js: Unknown usage of CommonJS `exports` object. This causes tree shaking to be disabled.
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/@polkadot/x-fetch/cjs/browser.js:3:23
2 |
> 3 | Object.defineProperty(exports, "__esModule", {
> | ^^^^^^^
4 | value: true
5 | });
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs
@parcel/transformer-js: Unknown usage of CommonJS `exports` object. This causes tree shaking to be disabled.
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/@polkadot/x-ws/cjs/browser.js:3:23
2 |
> 3 | Object.defineProperty(exports, "__esModule", {
> | ^^^^^^^
4 | value: true
5 | });
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs
@parcel/transformer-js: Unknown usage of CommonJS `exports` object. This causes tree shaking to be disabled.
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/@polkadot/x-ws/cjs/browser.js:7:23
6 | exports.WebSocket = void 0;
> 7 | Object.defineProperty(exports, "packageInfo", {
> | ^^^^^^^
8 | enumerable: true,
9 | get: function () {
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs
@parcel/transformer-js: Unknown usage of CommonJS `exports` object. This causes tree shaking to be disabled.
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/@polkadot/x-fetch/cjs/browser.js:7:23
6 | exports.fetch = void 0;
> 7 | Object.defineProperty(exports, "packageInfo", {
> | ^^^^^^^
8 | enumerable: true,
9 | get: function () {
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs
yarn: [2/4] Fetching packages
@parcel/transformer-js: Unknown usage of CommonJS `exports` object. This causes tree shaking to be disabled.
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/@polkadot/x-textdecoder/cjs/browser.js:3:23
2 |
> 3 | Object.defineProperty(exports, "__esModule", {
> | ^^^^^^^
4 | value: true
5 | });
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs
@parcel/transformer-js: Unknown usage of CommonJS `exports` object. This causes tree shaking to be disabled.
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/@polkadot/x-textencoder/cjs/browser.js:3:23
2 |
> 3 | Object.defineProperty(exports, "__esModule", {
> | ^^^^^^^
4 | value: true
5 | });
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs
@parcel/package-manager: yarn: " > react-iconly@2.2.5" has incorrect peer dependency "react@^16.8.6 || ^17".
@parcel/transformer-js: Unknown usage of CommonJS `exports` object. This causes tree shaking to be disabled.
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/@polkadot/x-textdecoder/cjs/browser.js:7:23
6 | exports.TextDecoder = void 0;
> 7 | Object.defineProperty(exports, "packageInfo", {
> | ^^^^^^^
8 | enumerable: true,
9 | get: function () {
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs
@parcel/transformer-js: Unknown usage of CommonJS `exports` object. This causes tree shaking to be disabled.
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/@polkadot/x-textencoder/cjs/browser.js:7:23
6 | exports.TextEncoder = void 0;
> 7 | Object.defineProperty(exports, "packageInfo", {
> | ^^^^^^^
8 | enumerable: true,
9 | get: function () {
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs
yarn: [3/4] Linking dependencies
@parcel/transformer-js: Conditional or non-top-level `require()` call. This causes the resolved module and all dependencies to be wrapped.
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/bn.js/lib/bn.js:56:16
55 | } else {
> 56 | Buffer = require('buffer').Buffer;
> | ^^^^^^^^^^^^^^^^^
57 | }
58 | } catch (e) {
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#avoid-conditional-require()
@parcel/transformer-js: Unknown usage of CommonJS `module` object. This causes the module to be wrapped, and tree shaking to be disabled.
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/bn.js/lib/bn.js:3547:37
3546 | };
> 3547 | })(typeof module === 'undefined' || module, this);
> | ^^^^^^
3548 |
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs
@parcel/transformer-js: Unknown usage of CommonJS `exports` object. This causes tree shaking to be disabled.
/Users/julien/Documents/Projects/jeluard/swipealot/node_modules/bn.js/lib/bn.js:3547:45
3546 | };
> 3547 | })(typeof module === 'undefined' || module, this);
> | ^^^^
3548 |
πŸ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs
yarn: [4/4] Building fresh packages
@parcel/package-manager: yarn: Saved lockfile.
@parcel/package-manager: yarn: Saved 1 new dependency.
@parcel/package-manager: yarn: Direct dependencies
@parcel/package-manager: yarn: All dependencies
Installing buffer...
yarn: [1/4] Resolving packages
yarn: [2/4] Fetching packages
yarn: [3/4] Linking dependencies
yarn: [4/4] Building fresh packages
@parcel/package-manager: yarn: Saved lockfile.
@parcel/package-manager: yarn: Saved 3 new dependencies.
@parcel/package-manager: yarn: Direct dependencies
@parcel/package-manager: yarn: All dependencies
✨ Built in 56.33s
dist/index.html 625 B 1.37s
dist/up_/assets/manifest.webmanifest 616 B 1.03s
dist/icon-32x32.5b6f584e.png 950 B 499ms
dist/icon-192x192.3c7a0fc0.png 5.67 KB 14.21s
dist/index.dd5f20f3.css 779 B 494ms
dist/Unbounded-Regular-707bbfc.5c6ff002.woff2 93.69 KB 1.03s
dist/Unbounded-Medium-707bbfc.8d02fa51.woff2 104.53 KB 477ms
dist/index.25b05204.js ⚠️ 6.18 MB 14.39s
dist/service-worker.js 13.43 KB 1.18s
✨ Done in 57.45s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment