-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use vite + vite-plugin-dts + @rollup/plugin-babel to build @warp-driv… (
#9388) * use vite + vite-plugin-dts + @rollup/plugin-babel to build @warp-drive/schema-record * womp womp, can't bundle types due to symbols being duplicated * Alternate: we can lie. ha
- Loading branch information
1 parent
470c78f
commit feb898e
Showing
6 changed files
with
652 additions
and
59 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
export const SOURCE = Symbol('#source'); | ||
export const MUTATE = Symbol('#update'); | ||
export const ARRAY_SIGNAL = Symbol('#signal'); | ||
export const OBJECT_SIGNAL = Symbol('#signal'); | ||
export const NOTIFY = Symbol('#notify'); | ||
export const SOURCE = Symbol('#source') as unknown as "#source"; | ||
export const MUTATE = Symbol('#update') as unknown as "#update"; | ||
export const ARRAY_SIGNAL = Symbol('#array-signal') as unknown as "#array-signal"; | ||
export const OBJECT_SIGNAL = Symbol('#object-signal') as unknown as "object-signal"; | ||
export const NOTIFY = Symbol('#notify') as unknown as "#notify"; | ||
|
||
export const Destroy = Symbol('Destroy'); | ||
export const Identifier = Symbol('Identifier'); | ||
export const Editable = Symbol('Editable'); | ||
export const Parent = Symbol('Parent'); | ||
export const Checkout = Symbol('Checkout'); | ||
export const Legacy = Symbol('Legacy'); | ||
export const Destroy = Symbol('Destroy') as unknown as "Destroy"; | ||
export const Identifier = Symbol('Identifier') as unknown as "Identifier"; | ||
export const Editable = Symbol('Editable') as unknown as "Editable"; | ||
export const Parent = Symbol('Parent') as unknown as "Parent"; | ||
export const Checkout = Symbol('Checkout') as unknown as "Checkout"; | ||
export const Legacy = Symbol('Legacy') as unknown as "Legacy"; |
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,53 @@ | ||
import { resolve } from 'node:path'; | ||
import { babel } from '@rollup/plugin-babel'; | ||
import { external } from '@warp-drive/internal-config/rollup/external.js'; | ||
import url from 'node:url'; | ||
|
||
import { defineConfig } from 'vite'; | ||
import dts from 'vite-plugin-dts'; | ||
//import { execaCommand } from 'execa'; | ||
|
||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
export default defineConfig({ | ||
esbuild: false, | ||
build: { | ||
outDir: 'dist', | ||
// These targets are not "support". | ||
// A consuming app or library should compile further if they need to support | ||
// old browsers. | ||
target: ['esnext', 'firefox121'], | ||
// In case folks debug without sourcemaps | ||
// | ||
// TODO: do a dual build, split for development + production | ||
// where production is optimized for CDN loading via | ||
// https://limber.glimdown.com | ||
minify: false, | ||
sourcemap: true, | ||
lib: { | ||
// Could also be a dictionary or array of multiple entry points | ||
entry: [ | ||
resolve(__dirname, 'src/hooks.ts'), | ||
resolve(__dirname, 'src/record.ts'), | ||
resolve(__dirname, 'src/schema.ts'), | ||
], | ||
name: '@warp-drive/schema-record', | ||
formats: ['es'], | ||
// the proper extensions will be added | ||
fileName: 'index', | ||
}, | ||
rollupOptions: { | ||
external: external(['@embroider/macros', '@ember/debug']), | ||
}, | ||
}, | ||
plugins: [ | ||
babel({ | ||
babelHelpers: 'inline', | ||
extensions: ['.js', '.ts'], | ||
}), | ||
dts({ | ||
rollupTypes: true, | ||
outDir: 'unstable-preview-types', | ||
}), | ||
], | ||
}); |
Oops, something went wrong.