ci: corrected building and bundeling with tsc vite
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,6 +4,7 @@ node_modules/
|
||||
# Build outputs
|
||||
dist/
|
||||
dist-ssr/
|
||||
bundle/
|
||||
*.local
|
||||
|
||||
# TypeScript cache
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
"dev": "vite build --watch",
|
||||
"build": "tsc && vite build",
|
||||
"build": "tsc",
|
||||
"bundle": "vite build",
|
||||
"test": "vitest",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
"declaration": true,
|
||||
"outDir": "./dist",
|
||||
|
||||
23
vite.config.ts
Normal file
23
vite.config.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { resolve } from "path";
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
lib: {
|
||||
entry: resolve(__dirname, "src/index.ts"),
|
||||
name: "VideoPlayer",
|
||||
fileName: (format) => `video-player.${format}.js`,
|
||||
formats: ["es", "umd"],
|
||||
},
|
||||
outDir: "bundle",
|
||||
emptyOutDir: true,
|
||||
rollupOptions: {
|
||||
external: ["hls.js"],
|
||||
output: {
|
||||
globals: {
|
||||
"hls.js": "Hls",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user