Comments (8)
Hey @uriklar, thanks for reaching out!
Have you tried actually consuming these example components in an app and can verify the css get's injected?
You can see the example components and CSS being utilized here: https://stackblitz.com/edit/example-rollup-react-component-npm-package?file=package.json
It'd be great to get some more background into what issues you're seeing.
from example-rollup-react-component-npm-package.
Hi @jaebradley. Thanks for the ultra quick response :-)
It was my mistake. I wasn't aware I need to import the css separately.
from example-rollup-react-component-npm-package.
@uriklar no worries - it's not particular clear from the README
that the CSS is built / imported separately. I'm hoping to add some more documentation in the future.
Cheers!
from example-rollup-react-component-npm-package.
While we're here.. I was wondering if during your research you've found a good resource on building a tree shakable component library with Rollup (or even Webpack)?
I'm trying to achieve that and though i've marked "sideEffects": false it seams like my consumer app is getting the whole bundle regardless of what i'm importing.
Thanks again for the response and for the great example!
from example-rollup-react-component-npm-package.
@uriklar are you tree-shaking ES6 modules only? Or are you transpiling ES6 modules into CommonJS?
from example-rollup-react-component-npm-package.
The latter, transpiling to common js too
from example-rollup-react-component-npm-package.
I think you need to tell Babel not to transpile ES6 modules so you can take advantage of static analysis.
https://developers.google.com/web/fundamentals/performance/optimizing-javascript/tree-shaking/
I could definitely be missing the ball on something as I don't know exactly what your setup is.
from example-rollup-react-component-npm-package.
Thanks a lot! I'll try it out
from example-rollup-react-component-npm-package.
Related Issues (19)
- Please, add babel/runtime to external HOT 2
- The automated release is failing 🚨
- How do you actually use the bundled UMD package? HOT 2
- Error when running Storybook HOT 1
- An in-range update of react is breaking the build 🚨 HOT 9
- An in-range update of eslint is breaking the build 🚨 HOT 5
- An in-range update of eslint-plugin-import is breaking the build 🚨 HOT 6
- An in-range update of webpack is breaking the build 🚨 HOT 4
- Add jest tests
- Add jest tests HOT 1
- Add more documentation on plugins used, rollup configuration, etc. HOT 1
- Add es-5 checker HOT 1
- An in-range update of rollup is breaking the build 🚨 HOT 7
- An in-range update of rollup is breaking the build 🚨 HOT 26
- An in-range update of eslint-plugin-react is breaking the build 🚨 HOT 4
- An in-range update of storybook is breaking the build 🚨 HOT 7
- An in-range update of babel7 is breaking the build 🚨 HOT 1
- An in-range update of babel7 is breaking the build 🚨 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 example-rollup-react-component-npm-package.