-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does this work with Rollup.js? #229
Comments
Hi @DaveSauce! I would recommend you integrate using a "static bundle". It is mainly targeted at people who aren't using webpack in their own pipeline. There's a little bit more work initially (as you have to provide the bundle yourself) but you have better control through the entire chain. Documentation is a little bare-bones at the moment. I made a Rollup demo a while back where you might be able to get some inspiration: https://github.com/happo/happo-static-package-demo I'm happy to help you along the way. You can post here or send an email to [email protected] and I'll respond as quickly as I can. @lencioni might also be able to answer some questions (if he has time). He made the static integration for Airbnb a few months back. |
@trotzig Thanks for the examples! Switching to the static bundle was pretty straightforward, but now I have a different error:
This does not seem to be browser specific - ie, I just get it for a different browser when I remove chrome from I'm wondering if this is TypeScript related? I removed |
Let me debug that. In the meantime, can you use the static bundle locally? It could be that there's an initialization error -- |
The fact that it happens on chrome in one case, and another browser in another case is that we show the error from the first failing browser. |
You were right, you don't need happo-plugin-typescript. |
Okay, it looks like there are a few issues here. The fact that it manifests as a
|
@trotzig I'm only attempting to run this locally right now. Haha - I just spent 2 minutes staring at I've been attempting to run Happo out of it's own static directory, instead of
|
Okay, yeah this is heading in the right direction. :) When you build import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
export default {
input: 'src/main.js',
output: {
file: 'static/bundle.js',
format: 'iife'
},
plugins: [nodeResolve(), commonjs()],
}; Could you use a similar approach? Apologies that this isn't better documented -- you're one of the first people to use this integration type and I appreciate all the feedback and your persistence! |
@trotzig Thanks for all of the help on this! 😁 I updated my rollup config like you described, and now I can see
|
Okay, that's some progress at least! I don't actually know what the |
That’s the new jsx transform from react; it’s enabled by default in react 17, and can be opted into in react 16. |
@trotzig I'm just seeing a blank screen when I run locally and visit When I run
|
Yeah that's expected. The If |
I have a component library that uses rollup.js and typescript. I've attempted to add WebPack to run Happo, but without any luck yet.
I've followed the install process for examples, but I get this error:
I've also added a
webpack.config.js
:and tried adding
babel-plugin-module-resolver
.babelrc
but none of these efforts have made a difference. This seems like a basic config issue, but it's been blocking me all day. This has me wondering if there is some fundamental incompatibility with Happo and a rollup based project. Is there an example of a working project with Happo and Rollup?
Happo seems like an exciting project, and I'd love to get it to work with my component library.
The text was updated successfully, but these errors were encountered: