rollup.config.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 0

Size

Lines of Code 45
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 2
c 3
b 0
f 0
nc 3
dl 0
loc 45
rs 10
wmc 2
mnd 2
bc 2
fnc 0
bpm 0
cpm 0
noi 0
1
import path from 'path'
2
import babel from 'rollup-plugin-babel'
3
4
/*
5
 If(!process.env.PROD_BUILD_MODE) {
6
 process.env.PROD_BUILD_MODE = 'commonjs'
7
 }
8
 */
9
10
const config = {
11
	entry: path.join(__dirname, '/src/index.js'),
12
	external: [
13
		'feathers-commons/lib/utils',
14
		'feathers-query-filters'
15
	],
16
	plugins: [
17
		babel({
18
			presets: [
19
				['env', {
20
					targets: {
21
						browsers: '> 1%, Last 2 versions, IE 9' // Based on vue's requirements
22
					},
23
					modules: false,
24
					loose: true
25
				}]
26
			],
27
			plugins: [
28
				'external-helpers'
29
			],
30
			babelrc: false
31
		})
32
	]
33
}
34
35
if (process.env.npm_lifecycle_event === 'build:commonjs') {
36
	// Common.js build
37
	config.format = 'cjs'
38
	config.dest = path.join(__dirname, '/dist/vue-syncers-feathers.common.js')
39
} else if (process.env.npm_lifecycle_event === 'build:esm') {
40
	// Common.js build
41
	config.format = 'es'
42
	config.dest = path.join(__dirname, '/dist/vue-syncers-feathers.esm.js')
43
}
44
45
export default config
46