-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
bc0fae9
to
6d9c49e
Compare
rollup.config.js
Outdated
function CJS() { | ||
return { | ||
input: [ | ||
"src/Button", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems strange that we'd need to modify our build config every time we add something to src
- can we just grab everything in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I made this change. It makes the config a little more confusing, but will be future-proof. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answering your question more directly, we can't grab everything. We have to exclude certain things, but that's fine! We can exclude scripts/ directories, stories, and test files easily.
6d9c49e
to
0c2459b
Compare
0c2459b
to
41c8331
Compare
I'm going to merge this in. We can roll back if necessary! |
🚀 PR was released in v2.22.0 🚀 |
Contributes to AP-1023
Why
We're going to use a 3rd party tooltip library to manage our tooltips and popovers. All 3rd party tooltip libraries require some CSS be included in the final bundle. Our current bundle process does not allow this because we use
tsc
.The solution I've chosen is to use Rollup. Rollup is intended to bundle packages together for consumption. This only builds a CJS build right now, but we can expand this to build a es module package that can be tree shaken automatically later.
Rollup does not support bundling css out of the box; we'll have to use a plugin for that (coming with the associated PR!).
Testing
This is tested by tryin git in AGM. We should find a way to run our test suite against our compiled output files so we can guarantee that everything works. See https://github.com/mdg-private/engine-frontend/pull/1995