-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.js
37 lines (32 loc) · 1.14 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
import { terser } from 'rollup-plugin-terser';
import * as meta from "./package.json"; //get info from package.json for copyright details
// `npm run build` -> `production` is true
// `npm run dev` -> `production` is false
const moduleName = `${meta.name}`; //Change this value to change module name
const copyright = `// ${meta.homepage} v${meta.version} Copyright ${(new Date).getFullYear()} ${meta.author.name}`; //make copyright statement
function onwarn(message, warn) {
if (message.code === "CIRCULAR_DEPENDENCY") return;
warn(message);
}
export default {
input: 'src/main.js',
output: [
{
file: 'public/js/glycoglyph.js', //change filename for output file to the filename you desire
format: 'umd', // Universal Module Definition for creating d3.js like module
//sourcemap: true,
name: moduleName,
plugins: [],
banner: copyright //adds the copyright
},
{
file: 'public/js/glycoglyph.min.js',
format: 'umd', // Universal Module Definition for creating d3.js like module
//sourcemap: true,
name: moduleName,
plugins: [
terser({ output: { preamble: copyright } }) // minify and add copyright
]
},
]
};