diff --git a/bin/build b/bin/build index 32e17c0..0685a91 100755 --- a/bin/build +++ b/bin/build @@ -5,6 +5,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.." yarn run vite build +tsc --emitDeclarationOnly + echo $DIR/src/editor/styles.scss $DIR/ $(npm bin)/sass $DIR/styles.scss > $DIR/styles.css diff --git a/package.json b/package.json index 8a13fe1..6557761 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "main": "./dist/formial.umd.js", "module": "./dist/formial.es.js", "source": "src/index.tsx", + "typings": "dist/index.d.ts", "engines": { "node": ">=10" }, diff --git a/src/editor/store.ts b/src/editor/store.ts index 508310b..2f89556 100644 --- a/src/editor/store.ts +++ b/src/editor/store.ts @@ -28,7 +28,7 @@ export interface Store { interface StoreContextI { store: Store - dispatch: React.Dispatch // (patch:any): void + dispatch: React.Dispatch } export const StoreContext = React.createContext(null as any as StoreContextI) diff --git a/tsconfig.json b/tsconfig.json index 8bc2656..b1c5b05 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ "esModuleInterop": true, "noImplicitReturns": true, "noImplicitThis": true, - "noImplicitAny": true, + "noImplicitAny": false, "strictNullChecks": true, "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, @@ -26,8 +26,7 @@ "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "isolatedModules": true, - "downlevelIteration": true, - "noEmit": true + "downlevelIteration": true }, "include": [ "src" diff --git a/vite.config.ts b/vite.config.ts index 8fc7e90..7edf9c0 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,8 +11,11 @@ export default defineConfig({ port: 7711, }, base: './', + build: { lib, + sourcemap: true, + emptyOutDir: true, rollupOptions: { // make sure to externalize deps that shouldn't be bundled @@ -20,12 +23,14 @@ export default defineConfig({ external: lib ? [ 'react', ] : [], + + plugins: [ ], output: { // Provide global variables to use in the UMD build // for externalized deps - // globals: { - // react: 'react', - // }, + globals: { + react: 'react', + }, }, }, },