forked from fergiemcdowall/stopword
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
44 lines (43 loc) · 1.38 KB
/
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
41
42
43
44
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import path from 'path'
import license from 'rollup-plugin-license'
export default [
// browser-friendly UMD build
// CommonJS (for Node) and ES module (for bundlers) build.
{
input: './src/stopword.js',
output: [
{ name: 'sw', file: './dist/stopword.umd.js', format: 'umd', exports: 'named' },
{ file: './dist/stopword.cjs.js', format: 'cjs' },
{ file: './dist/stopword.esm.mjs', format: 'es' }
],
plugins: [
resolve(), // so Rollup can find `ms`
commonjs() // so Rollup can convert `ms` to an ES module
]
},
// Minified versions
{
input: './src/stopword.js',
output: [
{ name: 'sw', file: './dist/stopword.umd.min.js', format: 'umd', exports: 'named' },
{ file: './dist/stopword.cjs.min.js', format: 'cjs' },
{ file: './dist/stopword.esm.min.mjs', format: 'es' }
],
plugins: [
resolve(), // so Rollup can find `ms`
commonjs(), // so Rollup can convert `ms` to an ES module
terser(), // Minify
license({ // Add reference to license file for minified scripts
banner: {
commentStyle: 'regular', // The default
content: {
file: path.join(__dirname, './src/reference.txt')
}
}
})
]
}
]