question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

parcel@next isn't bundling at all (without further config)

See original GitHub issue

πŸ› bug report

parcel is supposed to be zero-config, but parcel@2 seems to default to β€œbundling for node”, which isn’t Parcel’s most common purpose (I would guess)

πŸŽ› Configuration (.babelrc, package.json, cli command)

This is the full repro:

npm i webext-options-sync parcel@next --no-save
echo "import 'webext-options-sync'" > source.js
npx parcel build source.js
Old repro
npm init -y
npm i webext-options-sync parcel@next
echo "import 'webext-options-sync'" > source.js
npx parcel build source.js

πŸ€” Expected Behavior

✨  Built in 1.93s.

dist/source.js.map    61.69 KB     21ms
dist/source.js        18.06 KB    1.62s

The module webext-options-sync is bundled just like parcel@1 does.

😯 Current Behavior

✨ Built in 2.06s.
 
index.js         31 B     95ms
└── source.js    75 B    964ms

It generates index.js with this content:

require("webext-options-sync");

πŸ’ Possible Solution

Default to regular bundling for browsers, rather than generating a CommonJS file.

🌍 Your Environment

Software Version(s)
Parcel 2.0.0-alpha.3.2
Node v12.14.1
npm/Yarn 6.13.4
Operating System macOS 10.15.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
fregantecommented, Jan 13, 2020

Indeed. 😟

Can’t reproduce anymore

1reaction
mischniccommented, Jan 13, 2020

Ah, but that doesn’t happen for me?

niklas@nmb:abc $ rm package.json
niklas@nmb:abc $ npx parcel build source.js
✨ Built in 7.37s.

dist/source.js                                                   4.81 KB    985ms
β”œβ”€β”€ node_modules/lz-string/libs/lz-string.js                    17.85 KB    384ms
β”œβ”€β”€ node_modules/webext-options-sync/index.js                     7.7 KB    209ms
β”œβ”€β”€ node_modules/throttle-debounce/dist/index.esm.js             5.57 KB    385ms
β”œβ”€β”€ node_modules/dom-form-serializer/lib/serialize.js            2.28 KB     91ms
β”œβ”€β”€ node_modules/dom-form-serializer/lib/InputWriters.js         1.87 KB    1.90s
β”œβ”€β”€ node_modules/dom-form-serializer/lib/InputReaders.js         1.83 KB    170ms
β”œβ”€β”€ node_modules/dom-form-serializer/lib/deserialize.js          1.68 KB     92ms
β”œβ”€β”€ node_modules/webext-detect-page/module/index.js              1.56 KB    382ms
β”œβ”€β”€ node_modules/dom-form-serializer/lib/getInputElements.js     1.39 KB    1.90s
└── node_modules/matches-selector/index.js                       1.09 KB     80ms
└── + 10 more assets
niklas@nmb:abc $ echo '{}' > package.json
niklas@nmb:abc $ npx parcel build source.js
✨ Built in 1.66s.

dist/source.js                                                   4.81 KB    703ms
β”œβ”€β”€ node_modules/lz-string/libs/lz-string.js                    17.85 KB    384ms
β”œβ”€β”€ node_modules/webext-options-sync/index.js                     7.7 KB    209ms
β”œβ”€β”€ node_modules/throttle-debounce/dist/index.esm.js             5.57 KB    385ms
β”œβ”€β”€ node_modules/dom-form-serializer/lib/serialize.js            2.28 KB     91ms
β”œβ”€β”€ node_modules/dom-form-serializer/lib/InputWriters.js         1.87 KB    1.90s
β”œβ”€β”€ node_modules/dom-form-serializer/lib/InputReaders.js         1.83 KB    170ms
β”œβ”€β”€ node_modules/dom-form-serializer/lib/deserialize.js          1.68 KB     92ms
β”œβ”€β”€ node_modules/webext-detect-page/module/index.js              1.56 KB    382ms
β”œβ”€β”€ node_modules/dom-form-serializer/lib/getInputElements.js     1.39 KB    1.90s
└── node_modules/matches-selector/index.js                       1.09 KB     80ms
└── + 10 more assets
Read more comments on GitHub >

github_iconTop Results From Across the Web

Parcel2 v. Webpack - parcel bundle size is significantly larger
The main driver seems to be that this optimization that the library authors made is picked up by webpack but not by parcel....
Read more >
Getting Started With Parcel. Next Generation Web App Bundler
Zero configuration code splitting. Parcel is making sure that the project code is split across multiple bundles if not all assets are needed...
Read more >
Parcel-Bundler cannot fix high vulnerabilities - Stack Overflow
Today I was creating a new project and followed all the required steps and when I got to installing Parcel via npm install...
Read more >
parcel - npm
Automatically transforms modules using Babel, PostCSS, and PostHTML when needed - even node_modules . βœ‚οΈ Zero configuration code splittingΒ ...
Read more >
Exploring The Parcel Application Bundler - YouTube
In this video we will take a look at the brand new Parcel bundler which is a little to no configuration application bundler...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found