mirror of
https://github.com/farcasterxyz/hub-monorepo.git
synced 2026-02-15 23:45:12 -05:00
* Fix import mapping to work with built JS files This allows us to ship a Docker image that runs using `node` directly, rather than via `tsx`. * Remove use of top-level `await` expressions These were only used in tests and weren't critical. Switch away so we have the optional to convert to CommonJS if we need. * Switch all imports to use relative paths instead of ~ shortcut The ~ shortcut doesn't work in some contexts, which makes our lives more difficult when trying to output ESM. Since we were already using relative paths in some part of the codebase and not others, just switch to using relative paths everywhere for simplicity. * Switch imports to append .js extension And update Jest configuration to work with this extension. * Build single image instead of two separate ones We originally created the other image so that we could build an image using only packages published to NPM, but this proved problematic when wanting to test those changes without publishing. Since there are more situations where we'd want to ship an image using unpublished packages (i.e. for testing) remove the "public" image and update our "testing" image to also be used as the public image. However, a key difference is that the testing image will now run compiled JS instead of using a TypeScript interpreter.
17 lines
474 B
JavaScript
17 lines
474 B
JavaScript
import resolve from '@rollup/plugin-node-resolve';
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
import json from '@rollup/plugin-json';
|
|
|
|
export default {
|
|
input: 'build/cli.js',
|
|
output: {
|
|
file: 'rollup-bundle.js',
|
|
format: 'cjs', // immediately-invoked function expression — suitable for <script> tags
|
|
},
|
|
plugins: [
|
|
resolve(), // tells Rollup how to find date-fns in node_modules
|
|
commonjs(), // converts date-fns to ES modules
|
|
json(),
|
|
],
|
|
};
|