generated from johnfmorton/vite-module-builder-w-ghpages-npm-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
28 lines (26 loc) · 956 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
// This is the config file used to compile the module that will be published to NPM.
const path = require('path')
const { defineConfig } = require('vite')
import banner from 'vite-plugin-banner'
import pkg from './package.json'
// Now in UTC time. Format time as YYYY-MM-DDTHH:mm:ss.sssZ.
const now = new Date().toISOString()
module.exports = defineConfig({
build: {
lib: {
entry: path.resolve(
__dirname,
'lib/accessible-card-web-component.ts'
),
name: 'accessible-card-web-component',
fileName: (format) =>
`accessible-card-web-component.${format}.js`,
},
minify: false,
},
plugins: [
banner(
`/**\n * name: ${pkg.name}\n * version: v${pkg.version}\n * description: ${pkg.description}\n * author: ${pkg.author}\n * repository: ${pkg.repository.url}\n * build date: ${now} \n */`
),
],
})