Made it possible to build package by tsc

This commit is contained in:
porink0424
2024-03-27 14:58:46 +09:00
parent 08016ddd60
commit 393bfb6243
5 changed files with 7 additions and 25 deletions
+5 -3
View File
@@ -7,14 +7,16 @@
"main": "pkg/index.js",
"types": "types/index.d.ts",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build": "tsc -d",
"lint": "biome lint .",
"preview": "vite preview --port 5173",
"fmt": "biome format --write .",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"files": [
"pkg",
"types"
],
"repository": {
"type": "git",
"url": "git+https://github.com/optuna/optuna-dashboard.git"
-2
View File
@@ -1,2 +0,0 @@
export { DataGrid } from "./DataGrid";
export type { DataGridColumn } from "./DataGrid";
+2
View File
@@ -0,0 +1,2 @@
export { DataGrid } from "./components/DataGrid";
export type { DataGridColumn } from "./components/DataGrid";
-1
View File
@@ -16,7 +16,6 @@
"allowSyntheticDefaultImports": true,
"target": "ES2020",
"sourceMap": true,
"emitDeclarationOnly": true,
"declaration": true,
"declarationDir": "./types",
"strict": true,
-19
View File
@@ -1,6 +1,5 @@
import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vite";
import { resolve } from "path";
// https://vitejs.dev/config/
export default defineConfig({
@@ -16,22 +15,4 @@ export default defineConfig({
exclude: ["@sqlite.org/sqlite-wasm"],
},
plugins: [react()],
build: {
lib: {
entry: resolve(__dirname, "src/components/index.ts"),
name: "@optuna/storybook",
fileName: "index",
},
rollupOptions: {
external: ["react", "react-dom"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
},
outDir: "pkg",
emptyOutDir: false,
}
});