-
Notifications
You must be signed in to change notification settings - Fork 42
/
rollup.config.js
40 lines (38 loc) · 1021 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
import fs from 'fs';
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import cjs from 'rollup-plugin-commonjs';
const babelOptions = JSON.parse(fs.readFileSync('./.babelrc'));
export default {
output: {
format: 'umd',
globals: {
jquery: 'jQuery',
'popper.js': 'Popper',
},
},
external: ['jquery', 'popper.js'],
plugins: [
babel(Object.assign(babelOptions, {
exclude: 'node_modules/**', // only transpile our source code
externalHelpersWhitelist: [
// Include only required helpers
'defineProperties',
'createClass',
'inheritsLoose',
'extends',
'objectSpread',
'defineProperty',
],
}) ),
resolve({
mainFields: ['module', 'main'], // Default: ['module', 'main']
}),
cjs({
include: ['node_modules/bootstrap/**', 'node_modules/jquery/**'],
namedExports: {
'node_modules/jquery/dist/jquery.js': 'jquery',
},
}),
],
};