diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-12-30 12:05:27 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-12-30 12:05:27 +0100 |
commit | 62d816402c6ddccf22c9ac68822cf100f61662d6 (patch) | |
tree | 3963ce347ea0278e22f63eb16615ef3a23c23bf9 /packages/service-shared/esbuild.config.js | |
parent | build: Simplify clean script (diff) | |
download | sophie-62d816402c6ddccf22c9ac68822cf100f61662d6.tar.gz sophie-62d816402c6ddccf22c9ac68822cf100f61662d6.tar.zst sophie-62d816402c6ddccf22c9ac68822cf100f61662d6.zip |
build: Use shared packages through modules
By running the build for the shared packages only once, errors in them
are reported only once in watch mode.
We still have to point jest to the original source files (and rebuild
the shared source files as part of the test), because it won't load the
"module" entry of the shared packages. However, as a benefit, jest can
now run even if the shared packages haven't been built yet.
Diffstat (limited to 'packages/service-shared/esbuild.config.js')
-rw-r--r-- | packages/service-shared/esbuild.config.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/service-shared/esbuild.config.js b/packages/service-shared/esbuild.config.js new file mode 100644 index 0000000..ce57cd7 --- /dev/null +++ b/packages/service-shared/esbuild.config.js | |||
@@ -0,0 +1,21 @@ | |||
1 | // @ts-check | ||
2 | |||
3 | const { chrome } = require('../../config/build-common'); | ||
4 | const { getConfig } = require('../../config/esbuild-config'); | ||
5 | |||
6 | module.exports = getConfig({ | ||
7 | absWorkingDir: __dirname, | ||
8 | entryPoints: [ | ||
9 | 'src/index.ts', | ||
10 | ], | ||
11 | outfile: 'dist/index.mjs', | ||
12 | format: 'esm', | ||
13 | // The package that includes this one will have a header comment, | ||
14 | // no need to have an additional one here. | ||
15 | banner: {}, | ||
16 | platform: 'node', | ||
17 | target: chrome, | ||
18 | external: [ | ||
19 | 'zod', | ||
20 | ], | ||
21 | }); | ||