-
Notifications
You must be signed in to change notification settings - Fork 7
/
rollup.config.js
38 lines (36 loc) · 1.36 KB
/
rollup.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
import vue from '@pathscale/rollup-plugin-vue3'
import styles from 'rollup-plugin-styles'
import resolve from '@rollup/plugin-node-resolve'
import replace from '@rollup/plugin-replace'
import ts from '@wessberg/rollup-plugin-ts'
import externals from 'rollup-plugin-node-externals'
import pkg from './package.json'
// eslint-disable-next-line import/no-anonymous-default-export -- Used internally by Rollup
export default [
{
input: 'src/components/index.js',
external: ['vue'],
output: { format: 'es', file: pkg.module, assetFileNames: '[name][extname]' },
plugins: [
externals({ deps: true }),
resolve({ extensions: ['.vue', '.js', '.css'] }),
vue({ template: { isProduction: true }, preprocessStyles: false }),
ts(),
styles({ mode: ['extract', 'bundle.css'], url: { inline: true } }),
],
},
{
input: 'src/components/index.js',
output: { format: 'es', file: pkg.browser, assetFileNames: '[name][extname]' },
plugins: [
resolve({ extensions: ['.vue', '.js'] }),
vue({ template: { isProduction: false }, preprocessStyles: false }),
ts(),
// Vue plugin won't handle CSS currently
styles(),
// Not defined in browser
// eslint-disable-next-line node/no-process-env -- Used for build
replace({ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) }),
],
},
]