-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
31 lines (31 loc) · 831 Bytes
/
build.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
import * as path from 'path'
import { defineConfig } from 'vite'
import Banner from 'vite-plugin-banner'
import {version,name} from './package.json'
const getBannerContent = () => `
name: iframeBridge
version: ${version}
file: ${name}.min.js
author: web.szy
buildTime: ${new Date().toLocaleString()}
`
export default defineConfig({
cacheDir:path.resolve(__dirname,'./','.cache'),
plugins:[
Banner(getBannerContent())
],
build: {
target:"es2016",
sourcemap:false,
minify:true,
cssCodeSplit:true,
assetsInlineLimit:0,
manifest:false,
lib: {
entry: path.resolve(__dirname, 'src/index.js'),
formats:["es","umd"],
name: name,
fileName: (format) => `${name}.${format}.min.js`
}
}
})