-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathvite.config.esm.js
45 lines (42 loc) · 1.25 KB
/
vite.config.esm.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
/* eslint-disable import/no-extraneous-dependencies */
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vite';
import swc from '@rollup/plugin-swc';
const dirname = path.dirname(fileURLToPath(import.meta.url));
const config = defineConfig({
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: path.resolve(dirname, 'src/index.js'),
name: 'ReduxSounds',
formats: ['es'],
// the proper extensions will be added
fileName: 'redux-sounds'
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['howler/dist/howler.core.min.js'],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
'howler/dist/howler.core.min.js': 'Howler'
}
},
plugins: [swc({
env: {
targets: 'defaults and fully supports es6-module',
loose: true,
modules: false,
bugfixes: true,
shippedProposals: true,
coreJs: '3.37',
exclude: ['transform-typeof-symbol']
}
})]
}
}
});
export default config;