Passed
Push — master ( 39dea5...dace4e )
by Rafael S.
01:52
created

rollup.config.js (1 issue)

Labels
Severity
1
/*
2
 * Copyright (c) 2017-2018 Rafael da Silva Rocha.
3
 */
4
5
/**
6
 * @fileoverview rollup configuration file.
7
 * @see https://github.com/rochars/byte-data
8
 */
9
10
import closure from 'rollup-plugin-closure-compiler-js';
11
import fs from 'fs';
12
13
// Externs
14
const externsFile = fs.readFileSync('./externs/byte-data.js', 'utf8');
15
16
// Legal
17
const license = '/*!\n'+
18
  ' * https://github.com/rochars/byte-data.\n'+
19
  ' */\n';
20
21
// GCC wrapper
22
const outputWrapper = license + 'var window=window||{};'+
23
  '%output%' +
24
  'var module=module||{};module.exports=exports;' +
25
  'var define=define||function(){};' +
26
  'define(["exports"],function(exports){return module.exports;});'
27
28
export default [
29
  // ES6 bundle
30
  {
31
    input: 'main.js',
32
    output: [
33
      {
34
        file: 'dist/byte-data.js',
35
        format: 'es'
36
      },
0 ignored issues
show
The variable seems to be never declared. If this is a global, consider adding a /** global: */ comment.

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.

Loading history...
37
    ]
38
  },
39
  // ES5 UMD
40
  {
41
    input: 'main.js',
42
    output: [
43
      {
44
        file: 'dist/byte-data.umd.js',
45
        name: 'byteData',
46
        format: 'cjs',
47
        banner: 'var exports=exports||{};' +
48
        'window["byteData"]=exports;'
49
      }
50
    ],
51
    plugins: [
52
      closure({
53
        languageIn: 'ECMASCRIPT6',
54
        languageOut: 'ECMASCRIPT5',
55
        compilationLevel: 'ADVANCED',
56
        warningLevel: 'VERBOSE',
57
        outputWrapper: outputWrapper,
58
        externs: [{src: externsFile + 'exports={};'}]
59
      }),
60
    ]
61
  },
62
];
63