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", "HITL",
"innerhtml", "innerhtml",
"llms", "llms",
"onwarn",
"opensource", "opensource",
"qwen", "qwen",
"retryable", "retryable",

14
package-lock.json generated
View File

@@ -1540,20 +1540,6 @@
"node": ">=10" "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": { "node_modules/@microsoft/api-extractor/node_modules/yallist": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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