-
Notifications
You must be signed in to change notification settings - Fork 14
/
vite.config.js
48 lines (45 loc) · 1.28 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Copyright 2020 Harness Inc. All rights reserved.
* Use of this source code is governed by the PolyForm Shield 1.0.0 license
* that can be found in the licenses directory at the root of this repository, also available at
* https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt.
*/
const path = require('path')
const _ = require('lodash')
const package = require('./package.json')
const globals = require('../globals.json')
const dts = require('vite-plugin-dts')
const reactSvgPlugin = require('vite-plugin-react-svg')
const external = Object.keys(package.peerDependencies)
/**
* @type {import('vite').UserConfig}
*/
const config = {
build: {
lib: {
entry: path.resolve(__dirname, 'src'),
name: 'HarnessUseModal'
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external,
// plugins: [svgr()],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: _.pick(globals, external)
}
// plugins: [svgr({ icon: true })]
}
},
plugins: [
dts(),
reactSvgPlugin({
defaultExport: 'component',
svgo: true,
expandProps: 'end'
})
]
}
module.exports = config