Skip to content

Commit

Permalink
✨ Adding new exports to dedupe / deps include
Browse files Browse the repository at this point in the history
  • Loading branch information
amoutonbrady committed Jun 25, 2021
1 parent b36514b commit 7b7ca58
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ export default function solidPlugin(options: Partial<Options> = {}): Plugin {
if (!userConfig.resolve) userConfig.resolve = {};
userConfig.resolve.alias = [...legacyAlias, ...normalizeAliases(userConfig.resolve?.alias)];

const nestedDeps = [
'solid-js',
'solid-js/web',
'solid-js/store',
'solid-js/html',
'solid-js/h',
];

return mergeAndConcat(userConfig, {
/**
* We only need esbuild on .ts or .js files.
Expand All @@ -136,11 +144,11 @@ export default function solidPlugin(options: Partial<Options> = {}): Plugin {
esbuild: { include: /\.ts$/ },
resolve: {
conditions: ['solid', ...(replaceDev ? ['development'] : [])],
dedupe: ['solid-js', 'solid-js/web'],
dedupe: nestedDeps,
alias: [{ find: /^solid-refresh$/, replacement: runtimePublicPath }],
},
optimizeDeps: {
include: ['solid-js', 'solid-js/web'],
include: nestedDeps,
},
}) as UserConfig;
},
Expand Down

0 comments on commit 7b7ca58

Please sign in to comment.