Comments (9)
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.
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.
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.
relevant thread: FredKSchott/snowpack#303
from create-snowpack-app.
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.
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.
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.
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.
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)
- Babel Plugin import not working with snowpack HOT 1
- [webpack] Support non-SPA use-case HOT 1
- [plugin-webpack] Not compatible with [app-template-vue] HOT 1
- [plugin-webpack] Production builds: No bundle splitting based on `import(...)` directives HOT 9
- [plugin-svelte] Can not find App.css.js HOT 3
- Provide a blank template for Typescript HOT 4
- Feature request: Add pnpm as install option HOT 5
- Building is broken for Svelte HOT 5
- Add support for creating .gitignore from template HOT 5
- Can we have cli wizard prompts? HOT 6
- @snowpack/app-template-blank-typescript does not exist on NPM HOT 5
- onboard validations to ensure that the respective package manager is installed HOT 4
- plugin-dotenv doesn't work HOT 2
- [plugin-webpack] granular chunking for multi-page apps?
- [@snowpack/app-template-11ty] - HMR issue eleventy templates HOT 1
- Migrating Reactboilerplate app into CSA failing HOT 2
- [@snowpack/plugin-webpack] Use public path instead of baseUrl HOT 1
- [pnpm] missing dependencies in app-template-react-typescript (--use-pnpm) HOT 2
- svelte-typescript-template HOT 1
- Vue cannot use PostCSS in style tag. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-snowpack-app.