chore: get rid of build warnings

This commit is contained in:
Simon
2026-01-16 14:50:56 +08:00
parent ec2b744bab
commit c8bf0dd20f
8 changed files with 30 additions and 16 deletions

View File

@@ -5,6 +5,7 @@
"HITL",
"innerhtml",
"llms",
"onwarn",
"opensource",
"qwen",
"retryable",

14
package-lock.json generated
View File

@@ -1540,20 +1540,6 @@
"node": ">=10"
}
},
"node_modules/@microsoft/api-extractor/node_modules/typescript": {
"version": "5.8.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
"integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/@microsoft/api-extractor/node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",

View File

@@ -59,6 +59,9 @@
"vite": "^7.3.1",
"vite-plugin-css-injected-by-js": "^3.5.2"
},
"overrides": {
"typescript": "^5.9.3"
},
"lint-staged": {
"*.{js,ts,cjs,cts,mjs,mts}": [
"npx prettier --write --ignore-unknown",

View File

@@ -34,6 +34,13 @@ export default defineConfig(({ mode }) => {
outDir: resolve(__dirname, 'dist'),
emptyOutDir: !isDemo, // only empty on first build (full)
minify: false,
cssCodeSplit: true,
rollupOptions: {
onwarn: function (message, handler) {
if (message.code === 'EVAL') return
handler(message)
},
},
},
define: {
'process.env.NODE_ENV': '"production"',

View File

@@ -34,4 +34,3 @@ export default defineConfig({
'process.env.NODE_ENV': '"production"',
},
})

View File

@@ -31,13 +31,17 @@ export default defineConfig({
formats: ['umd'],
},
outDir: resolve(__dirname, 'dist', 'umd'),
cssCodeSplit: true,
rollupOptions: {
output: {
// force use .js as extension
entryFileNames: 'page-agent.js',
},
onwarn: function (message, handler) {
if (message.code === 'EVAL') return
handler(message)
},
},
cssCodeSplit: true,
},
define: {
'process.env.NODE_ENV': '"production"',

View File

@@ -30,6 +30,10 @@ export default defineConfig({
outDir: resolve(__dirname, 'dist', 'lib'),
rollupOptions: {
external: ['@page-agent/*', 'ai-motion'],
onwarn: function (message, handler) {
if (message.code === 'EVAL') return
handler(message)
},
},
minify: false,
sourcemap: true,

View File

@@ -20,6 +20,16 @@ export default defineConfig({
base: './',
clearScreen: false,
plugins: [react(), tailwindcss()],
build: {
chunkSizeWarningLimit: 2000,
cssCodeSplit: true,
rollupOptions: {
onwarn: function (message, handler) {
if (message.code === 'EVAL') return
handler(message)
},
},
},
resolve: {
alias: {
// Self root