-
Notifications
You must be signed in to change notification settings - Fork 129
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
adopt rollup #244
adopt rollup #244
Conversation
ec180d5
to
ab4bfa2
Compare
ab4bfa2
to
dfa505a
Compare
const missingFiles = difference(expectedFiles, actualFiles); | ||
const unexpectedFiles = difference(actualFiles, expectedFiles); |
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.
Fixing inverted logic!
export async function rollupClient(clientPath = getClientPath(), {minify = false} = {}): Promise<string> { | ||
const bundle = await rollup({input: clientPath, external: ["./runtime.js", /^https:/]}); | ||
try { | ||
const output = await bundle.generate({format: "es", plugins: minify ? [(terser as any)()] : []}); |
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.
The terser as any
here fixes a TypeScript error I don’t understand:
This expression is not callable.
Type 'typeof import("/Users/mbostock/Development/observablehq-multi/cli/node_modules/@rollup/plugin-terser/types/index")' has no call signatures.ts(2349)
It seems like TypeScript isn’t resolving the types correctly. 🤷
832b9a1
to
6ecd8c9
Compare
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.
nice!
Fixes #61. Fixes #233 (trivally; we can add tree shaking if we want to cut code size further). The diff is a bit large, but there are only a couple trivial changes to the code to break it up into more manageable files.
This uses a dedicated entry point for preview such that in build we don’t include the
open
function, reducing code size.In followup PRs, I would like to: