-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.dev.js
53 lines (50 loc) · 1.04 KB
/
rollup.config.dev.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
49
50
51
52
53
process.env.NODE_ENV = 'development'
const path = require('path')
import typescript from 'rollup-plugin-typescript2'
const serve = require('rollup-plugin-serve')
import livereload from 'rollup-plugin-livereload'
const replace = require('@rollup/plugin-replace')
import nodeResolve from 'rollup-plugin-node-resolve'
const resolveFile = function(filePath) {
return path.join(__dirname, '.', filePath)
}
export default {
input: './src/shoot/index.ts',
output: [
{
file: 'dist/shoot.umd.js',
format: 'umd',
name: 'Shoot'
},
{
file: 'dist/shoot.iife.js',
format: 'iife',
name: 'Shoot'
},
{
file: 'dist/shoot.esm.js',
format: 'esm'
},
{
file: 'dist/shoot.cjs.js'
}
],
watch: {
exclude: 'node_modules/**'
},
plugins: [
nodeResolve(),
typescript({
tsconfig: './tsconfig.json'
}),
replace({
'process.env.NODE_ENV': JSON.stringify( 'development' )
}),
serve({
port: 10003,
historyApiFallback: true,
contentBase: [resolveFile('example'), resolveFile('dist'), '.']
}),
livereload()
]
}