-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.release.config.js
81 lines (73 loc) · 1.57 KB
/
rollup.release.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import babel from 'rollup-plugin-babel'
import {uglify} from 'rollup-plugin-uglify'
import {terser} from 'rollup-plugin-terser'
import wcbuilder from '@author.io/rollup-plugin-wcbuilder'
const input = './src/element.js'
const outfile = 'author-tooltip.js'
const outdir = './dist'
const format = 'iife'
const pkg = require('./package.json')
const banner = `// Copyright (c) ${(new Date()).getFullYear()} ${pkg.author.name}. ${pkg.license} licensed.\n// ${pkg.name} v${pkg.version} available at ${pkg.repository.url.replace(/git\+|https:\/\/|\.git/gi, '')}\n// Last Build: ${(new Date().toLocaleString({ timeZone: 'UTC'}))}`
const options = {
dependencies: [
// tag names of dependee elements
]
}
const babelConfig = {
presets: [['@babel/preset-env', { modules: false }]]
}
const output = file => {
return {
name: 'AuthorTooltipElement',
file: `${outdir}/${outfile.replace(require('path').extname(outfile), '')}${file}`,
format,
banner,
sourcemap: true
}
}
export default [
// Standard (Minified ES6)
{
input,
plugins: [
wcbuilder(options),
terser()
],
output: [
output('.min.js')
]
},
// Legacy (Transpiled & Minified ES5)
{
input,
plugins: [
wcbuilder(options),
babel(babelConfig),
uglify()
],
output: [
output('.es5.min.js')
]
},
// Development: Standard (Unminified ES6)
{
input,
plugins: [
wcbuilder(options)
],
output: [
output('.js')
]
},
// Development: Legacy (Transpiled & Unminified ES5)
{
input,
plugins: [
wcbuilder(options),
babel(babelConfig)
],
output: [
output('.es5.js')
]
}
]