aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared/vite.config.js
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-30 00:26:01 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-30 02:24:28 +0100
commit61fd13c55f5e69a9d8b32dd0d74b08870783bcce (patch)
tree4f3f97b1629f3c262bea076b596bc7245ccbc0bd /packages/shared/vite.config.js
parentRevert "refactor: Switch back to consola for prettyness" (diff)
downloadsophie-61fd13c55f5e69a9d8b32dd0d74b08870783bcce.tar.gz
sophie-61fd13c55f5e69a9d8b32dd0d74b08870783bcce.tar.zst
sophie-61fd13c55f5e69a9d8b32dd0d74b08870783bcce.zip
build: Switch to esbuild
We will build all packages except the frontend (where vite remains in use) with esbuild. For some reason, the @yarnpkg/esbuild-plugin-pnp doesn't allow esbuild to load esm modules and we fall back to commonjs for dependencies. Hence we had to switch back to node_modules (but still rely on yarn hardlinking for a more efficient install).
Diffstat (limited to 'packages/shared/vite.config.js')
-rw-r--r--packages/shared/vite.config.js40
1 files changed, 0 insertions, 40 deletions
diff --git a/packages/shared/vite.config.js b/packages/shared/vite.config.js
deleted file mode 100644
index 5fb1ceb..0000000
--- a/packages/shared/vite.config.js
+++ /dev/null
@@ -1,40 +0,0 @@
1// @ts-check
2
3import { builtinModules } from 'module';
4
5import { chrome, makeConfig, node } from '../../config/vite-common';
6
7/** @type {string} */
8const PACKAGE_ROOT = __dirname;
9
10/**
11 * @type {import('vite').UserConfig}
12 * @see https://vitejs.dev/config/
13 */
14const config = makeConfig({
15 root: PACKAGE_ROOT,
16 build: {
17 target: [
18 chrome,
19 node,
20 ],
21 lib: {
22 entry: 'src/index.ts',
23 formats: [
24 'cjs',
25 'es',
26 ],
27 },
28 rollupOptions: {
29 external: [
30 'mobx',
31 'mobx-state-tree',
32 'zod',
33 ...builtinModules,
34 ],
35 },
36 emptyOutDir: false, // Do not remove .d.ts files.
37 },
38});
39
40export default config;