-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.fssrc.js
60 lines (54 loc) · 1.25 KB
/
.fssrc.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
// vim: set ft=javascript fdm=marker et ff=unix tw=80 sw=2:
// author: allex_wang <http://iallex.com>
import path from 'path'
import typescript from 'rollup-plugin-typescript2'
import { version, name, author, license, description, dependencies } from './package.json'
const banner = (name, short = false) => {
let s;
if (short) {
s = `/*! ${name} v${version} | ${license} licensed | ${author.name || author} */`
} else {
s = `/**
* ${name} v${version} - ${description}
*
* @author ${author}
* Released under the ${license} license.
*/`
}
return s
}
const resolve = p => path.resolve(__dirname, '.', p)
const plugins = [
'resolve',
typescript,
'commonjs'
]
export default {
destDir: resolve('lib'),
dependencies: { events: true, ...dependencies },
pluginOptions: {
resolve: {
alias: {
}
},
commonjs: {
sourceMap: false
},
replace: {
__VERSION__: version
},
typescript: {
typescript: require('@allex/typescript')
}
},
entry: [
{
input: resolve('src/CompositeKeyWeakMap.ts'),
plugins,
output: [
{ format: 'es', file: 'index.esm.js', banner: banner(name, true) },
{ format: 'cjs', file: 'index.js', banner: banner(name) }
]
}
]
}