Giter Site home page Giter Site logo

Comments (9)

jamesopstad avatar jamesopstad commented on August 9, 2024 1

I'm happy for this to be closed as it's more of a Parcel issue and that's no longer included by default.

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on August 9, 2024

Interesting, thanks for filing! I'm surprised Parcel isn't tree-shaking this properly, we'll need to dig in to see what's happening & how to fix.

from create-snowpack-app.

ervwalter avatar ervwalter commented on August 9, 2024

Parcel v1 doesn't do tree-shaking by default. You have to pass --experimental-scope-hoisting on the parcel command line.

Note, I have personally found it to be not 100% reliable (perhaps that is why it is labeled experimental). For example, I had another project using grommet and parcel's tree shaking crashed. I don't know if it was a problem with grommet's es6 modules code or with parcel, and my project was small enough that I didn't bother figuring it out and just turned tree-shaking off.

I don't know if Parcel v2 is better.

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on August 9, 2024

relevant thread: FredKSchott/snowpack#303

from create-snowpack-app.

pngwn avatar pngwn commented on August 9, 2024

Can I ask why you chose to use Parcel for production bundling when you are already using rollup internally? I've found parcel problematic in the past and issues like this hint at some of the issues. I'm sure they will get fixed eventually but rollup is much further along this path.

In my case, this will probably mean I need to maintain separate configs for dev and prod as Parcel does not fulfil my requirements.

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on August 9, 2024

The short answer is that Rollup/Webpack are JavaScript bundlers, and Parcel is a full application bundler. Parcel is the only bundler we've found that tackles the entire application, using your HTML file as the starting point just like your browser does. We couldn't offer zero-config bundles without it.

from create-snowpack-app.

pngwn avatar pngwn commented on August 9, 2024

I could understand that if the output were suitable for production.

My experience has been that ‘no config’ has never applied even to simple side projects, that coupled with the unsuitable output just makes the bundle option fun for certain projects but far from ‘optimised’.

Many projects with more complex requirements or strict performance demands will get little out of the bundle option, which is a shame.

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on August 9, 2024

I think the Parcel 2 output will be a good benchmark to have this convo with real data, vs. personal opinions/experiences.

But to be clear, Snowpack isn't zero config. It's just that we handle all of the building so that by the time it gets to Parcel, there's nothing left to configure other than the bundling strategy itself (how to code-split and when). I could definitely see that config being supported

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on August 9, 2024

sgtm, we've also implemented splitting of the JS & CSS output that comes from a Svelte file, which should help reduce JS bundle size as well.

from create-snowpack-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.