-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathrollup.config.js
42 lines (38 loc) · 1.06 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
39
40
41
42
import svelte from 'rollup-plugin-svelte'
import resolve from '@rollup/plugin-node-resolve'
import filesize from 'rollup-plugin-filesize'
import alias from '@rollup/plugin-alias'
import commonjs from '@rollup/plugin-commonjs'
import autoPreprocess from 'svelte-preprocess'
import istanbul from 'rollup-plugin-istanbul'
const resolvedCypressSvelteUnitTest = require.resolve('.')
const isProduction = process.env.NODE_ENV === 'production'
const isDevelopment = !isProduction
export default {
input: 'src/main.js',
output: {
file: 'public/bundle.js',
format: 'iife',
sourcemap: true,
},
plugins: [
alias({
entries: {
'cypress-svelte-unit-test': resolvedCypressSvelteUnitTest,
},
}),
resolve(),
commonjs(),
svelte({
preprocess: autoPreprocess(),
}),
// during normal testing we want to collect code coverage
// include all source files, but exclude spec files
isDevelopment &&
istanbul({
include: ['cypress/components/**'],
exclude: ['**/*spec.js'],
}),
filesize(),
],
}