-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathvite.config.js
33 lines (31 loc) · 938 Bytes
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { defineConfig } from 'vite'
import banner from 'vite-plugin-banner'
import pkg from './package.json'
const outDir = '../dist'
export default defineConfig({
base: '/pilpil/',
root: 'src',
build: {
outDir: outDir,
minify: true,
polyfillModulePreload: false,
rollupOptions: {
output: {
chunkFileNames: pkg.name+'.js',
entryFileNames: pkg.name+'.js',
assetFileNames: ({name}) => {
if (/\.css$/.test(name ?? '')) {
return pkg.name+'[extname]';
}
// default value
// ref: https://rollupjs.org/guide/en/#outputassetfilenames
return pkg.name+'[extname]';
},
},
}
},
plugins: [banner({
outDir,
content: `/**\n* ${pkg.title} v${pkg.version} - ${pkg.description}\n* @link ${pkg.homepage}\n* @copyright 2015-${new Date().getFullYear()} ${pkg.author}\n* @license ${pkg.license}\n*/`
})],
})