forked from victordibia/handtrack.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
36 lines (33 loc) · 851 Bytes
/
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
import minify from 'rollup-plugin-babel-minify';
import resolve from 'rollup-plugin-node-resolve';
import fs from 'fs';
import path from 'path';
const copyPlugin = function (options) {
return {
generateBundle() {
const targDir = path.dirname(options.targ);
if (!fs.existsSync(targDir)) {
fs.mkdirSync(targDir);
}
fs.writeFileSync(options.targ, fs.readFileSync(options.src));
}
};
};
export default {
input: 'src/index.js',
output: [{
file: 'dist/handtrack.min.js',
format: 'umd',
name: 'handTrack',
}, {
file: 'demo/handtrack.min.js',
format: 'umd',
name: 'handTrack',
}],
plugins: [resolve(), minify()]
// plugins: [resolve()]
// plugins: [resolve(), copyPlugin({
// src: 'src/index.js',
// targ: 'demoreact/node_modules/handtrackjs/src/index.js'
// })]
}