1 | /* |
||
2 | * Copyright (c) 2018 Rafael da Silva Rocha. |
||
3 | */ |
||
4 | |||
5 | /** |
||
6 | * @fileoverview rollup configuration file. |
||
7 | * @see https://github.com/rochars/utf8-buffer |
||
8 | */ |
||
9 | |||
10 | import closure from 'rollup-plugin-closure-compiler-js'; |
||
11 | import resolve from 'rollup-plugin-node-resolve'; |
||
12 | import commonjs from 'rollup-plugin-commonjs'; |
||
13 | import fs from 'fs'; |
||
14 | |||
15 | // Externs |
||
16 | const externsFile = fs.readFileSync('./externs/utf8-buffer.js', 'utf8'); |
||
17 | |||
18 | // Legal |
||
19 | const license = '/*!\n'+ |
||
20 | ' * https://github.com/rochars/utf8-buffer.\n'+ |
||
21 | ' * Copyright (c) 2018 Rafael da Silva Rocha.\n' + |
||
22 | ' */\n'; |
||
23 | |||
24 | // GCC wrapper |
||
25 | const outputWrapper = license + '"use strict";if(typeof exports!=="undefined"){var window={};}'+ |
||
26 | '%output%' + |
||
27 | 'var module=module||{};module.exports=exports;' + |
||
28 | 'var define=define||function(){};' + |
||
29 | 'define(["exports"],function(e){return module.exports;});' |
||
30 | |||
31 | export default [ |
||
32 | // ES6 bundle |
||
33 | { |
||
34 | input: 'main.js', |
||
35 | output: [ |
||
36 | { |
||
37 | file: 'dist/utf8-buffer.js', |
||
38 | format: 'es' |
||
39 | }, |
||
0 ignored issues
–
show
|
|||
40 | ], |
||
41 | plugins: [ |
||
42 | resolve(), |
||
43 | commonjs() |
||
44 | ] |
||
45 | }, |
||
46 | // ES5 UMD |
||
47 | { |
||
48 | input: 'main.js', |
||
49 | output: [ |
||
50 | { |
||
51 | file: 'dist/utf8-buffer.umd.js', |
||
52 | name: 'utf8Buffer', |
||
53 | format: 'cjs', |
||
54 | strict: false, |
||
55 | banner: 'var exports=exports||{};' + |
||
56 | 'if(window){window["utf8Buffer"]=exports;}' |
||
57 | } |
||
58 | ], |
||
59 | plugins: [ |
||
60 | resolve(), |
||
61 | commonjs(), |
||
62 | closure({ |
||
63 | languageIn: 'ECMASCRIPT6', |
||
64 | languageOut: 'ECMASCRIPT5', |
||
65 | compilationLevel: 'ADVANCED', |
||
66 | warningLevel: 'VERBOSE', |
||
67 | outputWrapper: outputWrapper, |
||
68 | externs: [{src: externsFile + 'exports={};'}] |
||
69 | }), |
||
70 | ] |
||
71 | }, |
||
72 | ]; |
||
73 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.