rochars /
minibuffer
| 1 | /* |
||
| 2 | * https://github.com/rochars/minibuffer |
||
| 3 | * Copyright (c) 2018 Rafael da Silva Rocha. |
||
| 4 | */ |
||
| 5 | |||
| 6 | /** |
||
| 7 | * @fileoverview rollup configuration file. |
||
| 8 | */ |
||
| 9 | |||
| 10 | import closure from 'rollup-plugin-closure-compiler-js'; |
||
| 11 | import babel from 'rollup-plugin-babel'; |
||
| 12 | import resolve from 'rollup-plugin-node-resolve'; |
||
| 13 | import commonjs from 'rollup-plugin-commonjs'; |
||
| 14 | |||
| 15 | // Read externs definitions |
||
| 16 | const fs = require('fs'); |
||
| 17 | const externsSrc = fs.readFileSync('./externs/minibuffer.js', 'utf8'); |
||
| 18 | |||
| 19 | // License notes |
||
| 20 | const licenseSrc = fs.readFileSync('./LICENSE', 'utf8'); |
||
|
0 ignored issues
–
show
Unused Code
introduced
by
Loading history...
|
|||
| 21 | const license = '/*!\n'+ |
||
| 22 | 'https://github.com/rochars/minibuffer\n' + |
||
| 23 | 'Copyright (c) 2018 Rafael da Silva Rocha.' + |
||
| 24 | '\n */\n'; |
||
| 25 | |||
| 26 | export default [ |
||
| 27 | // cjs, es |
||
| 28 | { |
||
| 29 | input: 'index.js', |
||
| 30 | output: [ |
||
| 31 | { |
||
| 32 | file: 'dist/minibuffer.cjs.js', |
||
| 33 | name: 'minibuffer', |
||
| 34 | footer: 'module.exports.default = MiniBuffer;', |
||
| 35 | format: 'cjs' |
||
| 36 | }, |
||
| 37 | { |
||
| 38 | file: 'dist/minibuffer.js', |
||
| 39 | format: 'es' |
||
| 40 | } |
||
| 41 | ], |
||
| 42 | plugins: [ |
||
| 43 | resolve(), |
||
| 44 | commonjs() |
||
| 45 | ] |
||
| 46 | }, |
||
| 47 | // umd |
||
| 48 | { |
||
| 49 | input: 'index.js', |
||
| 50 | output: [ |
||
| 51 | { |
||
| 52 | file: 'dist/minibuffer.umd.js', |
||
| 53 | name: 'MiniBuffer', |
||
| 54 | format: 'umd', |
||
| 55 | } |
||
| 56 | ], |
||
| 57 | plugins: [ |
||
| 58 | resolve(), |
||
| 59 | commonjs(), |
||
| 60 | babel() |
||
| 61 | ] |
||
| 62 | }, |
||
| 63 | // browser |
||
| 64 | { |
||
| 65 | input: 'index.js', |
||
| 66 | output: [ |
||
| 67 | { |
||
| 68 | name: 'mb', |
||
| 69 | format: 'iife', |
||
| 70 | file: 'dist/minibuffer.min.js', |
||
| 71 | banner: license, |
||
| 72 | footer: 'window["MiniBuffer"]=mb;' |
||
| 73 | } |
||
| 74 | ], |
||
| 75 | plugins: [ |
||
| 76 | resolve(), |
||
| 77 | commonjs(), |
||
| 78 | closure({ |
||
| 79 | languageIn: 'ECMASCRIPT6', |
||
| 80 | languageOut: 'ECMASCRIPT5', |
||
| 81 | compilationLevel: 'ADVANCED', |
||
| 82 | warningLevel: 'VERBOSE', |
||
| 83 | externs: [{src:externsSrc}] |
||
| 84 | }) |
||
| 85 | ] |
||
| 86 | } |
||
| 87 | ]; |
||
| 88 |