Skip to content

Commit

Permalink
fix(core): defined vite config resolve.alias for fp-ts, io-ts and io-…
Browse files Browse the repository at this point in the history
…ts-types
  • Loading branch information
ascariandrea committed Jun 24, 2024
1 parent 0fe3ae1 commit 2219695
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions packages/@liexp/core/src/frontend/vite/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,16 @@ export const defineViteConfig = <A extends Record<string, any>>(
minify: mode === "production",
commonjsOptions: {
include: [/node_modules/],
// exclude: [/@liexp\/core/, /@liexp\/shared/, /@liexp\/ui/],
transformMixedEsModules: true,
},
},
assetsInclude: ["@liexp/ui/assets/main.css"],
css: {
devSourcemap: true,
},
optimizeDeps: {
entries: [
path.join(config.cwd, "src/**"),
],
include: mode === 'production' ? undefined : [
'@liexp/*/**',
],
entries: [path.join(config.cwd, "src/**")],
include: ["@liexp/*/lib/**"],
},

resolve: {
Expand All @@ -104,6 +100,18 @@ export const defineViteConfig = <A extends Record<string, any>>(
find: "react/jsx-dev-runtime.js",
replacement: "react/jsx-dev-runtime",
},
{
find: /^fp-ts\/(\w+)$/,
replacement: "fp-ts/lib/$1.js",
},
{
find: /^io-ts\/(\w+)$/,
replacement: "io-ts/lib/$1.js",
},
{
find: /^io-ts-types\/(\w+)$/,
replacement: "io-ts-types/lib/$1.js",
},
],
},
server: config.devServer
Expand Down Expand Up @@ -132,13 +140,10 @@ export const defineViteConfig = <A extends Record<string, any>>(
react({
jsxRuntime: "classic",
}),
...(config.plugins ?? [])
...(config.plugins ?? []),
],
esbuild: {
jsx: "automatic",
exclude: [
'fp-ts'
]
},
};

Expand Down

0 comments on commit 2219695

Please sign in to comment.