Issues pre-bundling twin components with Rollup and importing them
See original GitHub issueHey,
This may be a dumb question.
If i publish a package to NPM … say button that i use this macro within and then publish. If i then import this package with the button would this still work?
for example…
import tw from "twin.macro";
const Button = () => <button tw="w-32 m-10 p-5 block opacity-50 hover:opacity-100">ddd</button>
export default Button;
nextjs site
import Button from "package";
const page = () => <Button />
export default page;
should that work or am i missing the point the macros in that it is only compile time… I use rollup for button example
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (8 by maintainers)
Top Results From Across the Web
Pre-bundled dependencies doesn't dedupe imports ... - GitHub
This is the problem, Component.vue will import bar from it's relative './shared.js file, but .vite/foo-library.js has its own bar reference!
Read more >Rollup & React- How to separate component bundles?
Currently I am using typescript and rollup, and I am able to bundle a single index.js and I am able to import those...
Read more >How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
Inside, we import the Babel plugin, then add it to a new configuration property called plugins , which will hold an array of...
Read more >Comparing the New Generation of Build Tools - CSS-Tricks
How are these different from existing tools? Whether we use webpack, Rollup, or Parcel for a development server, the tool bundles our entire ......
Read more >Code-splitting for libraries—bundling for npm with Rollup 1.0
This can lead to nasty issues, though, if different parts of the users's code import our library in different ways. Imagine one module...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Valid point, I’ll see what I can put together on the topic.
Check out the Twin component library monorepo for a pretty sweet component library setup 🎉
I’m closing up this issue now but feel free to reopen if there are any further issues.