diff --git a/packages/ui-stencil-react/package.json b/packages/ui-stencil-react/package.json index 9f11780a..d3b51569 100644 --- a/packages/ui-stencil-react/package.json +++ b/packages/ui-stencil-react/package.json @@ -4,11 +4,11 @@ "description": "React components for Orama Cloud", "license": "Apache-2.0", "author": "", - "main": "dist/index.js", - "module": "dist/index.js", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", "files": ["dist"], "scripts": { - "build": "npm run tsc", + "build": "tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json ./tsconfig.types.json", "clean": "rm -rf node_modules .turbo", "test": "node ./__tests__/react-library.test.js", "tsc": "tsc -p . --outDir ./dist" diff --git a/packages/ui-stencil-react/tsconfig.cjs.json b/packages/ui-stencil-react/tsconfig.cjs.json new file mode 100644 index 00000000..ac31cb33 --- /dev/null +++ b/packages/ui-stencil-react/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist/cjs", + "module": "commonjs" + } +} diff --git a/packages/ui-stencil-react/tsconfig.esm.json b/packages/ui-stencil-react/tsconfig.esm.json new file mode 100644 index 00000000..5eebe61c --- /dev/null +++ b/packages/ui-stencil-react/tsconfig.esm.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist/esm", + "module": "es2015" + } +} diff --git a/packages/ui-stencil-react/tsconfig.json b/packages/ui-stencil-react/tsconfig.json index ae5f000b..bc38fa01 100644 --- a/packages/ui-stencil-react/tsconfig.json +++ b/packages/ui-stencil-react/tsconfig.json @@ -1,21 +1,17 @@ { "compilerOptions": { - "declaration": true, "noImplicitAny": false, "removeComments": true, "noLib": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": true, - "outDir": "./dist", "lib": ["dom", "es2015"], - "module": "es2015", "moduleResolution": "node", "target": "es2015", "skipLibCheck": true, "jsx": "react", - "allowSyntheticDefaultImports": true, - "declarationDir": "./dist/types" + "allowSyntheticDefaultImports": true }, "include": ["src"], "exclude": ["node_modules", "**/*.spec.ts", "**/__tests__/**"] diff --git a/packages/ui-stencil-react/tsconfig.types.json b/packages/ui-stencil-react/tsconfig.types.json new file mode 100644 index 00000000..29252053 --- /dev/null +++ b/packages/ui-stencil-react/tsconfig.types.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist/types", + "declaration": true, + "declarationDir": "./dist/types", + "emitDeclarationOnly": true + } +}