-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(solid): remove preset and simplify
tsup
configuration (#373)
--------- Co-authored-by: Abdelrahman Ashraf <[email protected]>
- Loading branch information
1 parent
9f8973d
commit 7c8dfe3
Showing
5 changed files
with
435 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lottiefiles/dotlottie-solid': patch | ||
--- | ||
|
||
refactor(solid): remove preset and simplify tsup configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../tsconfig.build.json", | ||
"compilerOptions": { | ||
"outDir": "./dist", | ||
"jsx": "preserve", | ||
"jsxImportSource": "solid-js", | ||
"exactOptionalPropertyTypes": false | ||
}, | ||
"include": ["./src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,13 @@ | ||
import { solidPlugin } from 'esbuild-plugin-solid'; | ||
import { defineConfig } from 'tsup'; | ||
// eslint-disable-next-line import/no-namespace | ||
import * as preset from 'tsup-preset-solid'; | ||
|
||
const presetOptions: preset.PresetOptions = { | ||
entries: [ | ||
{ | ||
entry: 'src/index.ts', | ||
}, | ||
], | ||
// Set to `true` to remove all `console.*` calls and `debugger` statements in prod builds | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
drop_console: false, | ||
// Set to `true` to generate a CommonJS build alongside ESM | ||
// cjs: true, | ||
}; | ||
|
||
export default defineConfig((config) => { | ||
const watching = Boolean(config.watch); | ||
|
||
const parsedOptions = preset.parsePresetOptions(presetOptions, watching); | ||
|
||
if (!watching) { | ||
const packageFields = preset.generatePackageExports(parsedOptions); | ||
|
||
// will update ./package.json with the correct export fields | ||
preset.writePackageJson(packageFields); | ||
} | ||
|
||
return preset.generateTsupOptions(parsedOptions); | ||
export default defineConfig({ | ||
entry: ['src/index.ts'], | ||
clean: true, | ||
dts: true, | ||
sourcemap: true, | ||
format: ['esm'], | ||
tsconfig: 'tsconfig.build.json', | ||
external: ['solid-js'], | ||
esbuildPlugins: [solidPlugin()], | ||
}); |
Oops, something went wrong.