forked from projectblacklight/blacklight_range_limit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
37 lines (29 loc) · 859 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
'use strict'
import includePaths from 'rollup-plugin-includepaths';
const path = require('path')
const BUNDLE = process.env.BUNDLE === 'true'
const ESM = process.env.ESM === 'true'
const fileDest = `blacklight_range_limit${ESM ? '.esm' : '.umd'}`
const external = []
const globals = {}
let includePathOptions = {
include: {},
paths: ['app/javascript'],
external: [],
extensions: ['.js']
};
const rollupConfig = {
input: path.resolve(__dirname, `app/javascript/blacklight_range_limit/index.js`),
output: {
file: path.resolve(__dirname, `app/assets/javascripts/blacklight_range_limit/${fileDest}.js`),
format: ESM ? 'esm' : 'umd',
globals,
generatedCode: 'es2015'
},
external,
plugins: [includePaths(includePathOptions)]
}
if (!ESM) {
rollupConfig.output.name = 'BlacklightRangeLimit'
}
module.exports = rollupConfig