-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathrollup.config.base.js
60 lines (55 loc) · 1.35 KB
/
rollup.config.base.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const path = require('path')
const babel = require('rollup-plugin-babel')
const commonjs = require('@rollup/plugin-commonjs')
const html = require('rollup-plugin-html')
const namedDirectory = require('rollup-plugin-named-directory')
const postcss = require('rollup-plugin-postcss')
const replace = require('@rollup/plugin-replace')
const { nodeResolve } = require('@rollup/plugin-node-resolve')
const svg = require('rollup-plugin-svg')
const { version } = require('./package.json')
const { version: clapprCoreVersion } = require('@clappr/core/package.json')
const postcssOptions = {
use: [
['sass', {
includePaths: [
path.resolve('node_modules/@clappr/core/src/base/scss')
]
}]
],
inject: false,
}
const baseConfig = {
input: 'src/main.js',
external: ['@clappr/core'],
output: [
{
file: 'dist/clappr-plugins.js',
format: 'umd',
name: 'ClapprPlugins',
globals: {
'@clappr/core': 'Clappr',
}
},
],
plugins: [
replace({
VERSION: JSON.stringify(version),
CLAPPR_CORE_VERSION: JSON.stringify(clapprCoreVersion),
preventAssignment: false,
}),
commonjs(),
nodeResolve(),
namedDirectory(),
babel({
exclude: 'node_modules/**'
}),
html(),
svg(),
postcss(postcssOptions),
],
}
module.exports = {
baseConfig,
postcssOptions,
}