forked from Shopify/js-buy-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup-common.config.js
42 lines (41 loc) · 1022 Bytes
/
rollup-common.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
/* eslint-env node */
import {readFileSync} from 'fs';
import babel from 'rollup-plugin-babel';
import json from 'rollup-plugin-json';
import nodeResolve from 'rollup-plugin-node-resolve';
import sizes from 'rollup-plugin-sizes';
export default function generateBaseRollupConfig() {
return {
plugins: [
json({
exclude: './schema.json'
}),
nodeResolve({
jsnext: true,
main: true
}),
babel({
babelrc: false,
presets: [
[`${process.cwd()}/node_modules/babel-preset-env/lib/index`, {
targets: {
browsers: ['last 2 versions'],
node: '8.1.2'
},
modules: false
}]
],
plugins: [
`${process.cwd()}/node_modules/babel-plugin-external-helpers/lib/index`
]
}),
sizes()
],
banner: `/*
${readFileSync('./LICENSE.txt')}
*/`,
entry: 'src/client.js',
moduleName: 'ShopifyBuy',
sourceMap: true
};
}