-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.config.js
45 lines (41 loc) · 949 Bytes
/
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
43
44
45
import path from 'path'
import babel from 'rollup-plugin-babel'
/*
If(!process.env.PROD_BUILD_MODE) {
process.env.PROD_BUILD_MODE = 'commonjs'
}
*/
const config = {
entry: path.join(__dirname, '/src/index.js'),
external: [
'feathers-commons/lib/utils',
'feathers-query-filters'
],
plugins: [
babel({
presets: [
['env', {
targets: {
browsers: '> 1%, Last 2 versions, IE 9' // Based on vue's requirements
},
modules: false,
loose: true
}]
],
plugins: [
'external-helpers'
],
babelrc: false
})
]
}
if (process.env.npm_lifecycle_event === 'build:commonjs') {
// Common.js build
config.format = 'cjs'
config.dest = path.join(__dirname, '/dist/vue-syncers-feathers.common.js')
} else if (process.env.npm_lifecycle_event === 'build:esm') {
// Common.js build
config.format = 'es'
config.dest = path.join(__dirname, '/dist/vue-syncers-feathers.esm.js')
}
export default config