forked from cydrobolt/nullchat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
51 lines (46 loc) · 1.49 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* eslint-disable no-console */
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import copy from 'rollup-plugin-copy-assets';
import cleaner from 'rollup-plugin-cleaner';
import progress from 'rollup-plugin-progress';
import json from '@rollup/plugin-json';
import replace from '@rollup/plugin-replace';
import copy2 from 'rollup-plugin-copy';
import path from 'path';
import nodejs from './replace'
export default [
{
input: './runnull.js',
output: {
file: path.join(__dirname, '.bin', 'null.js'),
format: 'cjs',
},
plugins: [
progress(),
resolve({
preferBuiltins: true
}),
json(),
// Pass options here (optional)
cleaner({
targets: ['./.bin/'],
}),
replace({
'commonjsRequire.resolve': 'require.resolve'
}),
commonjs(),
nodejs(),
copy({
assets: ['./public', './views', './directives'],
silent: false,
}),
copy2({
targets: [
{ src: require.resolve('socket.io-client/dist/socket.io.js'), dest: '.bin/node_modules/socket.io-client/dist' },
{ src: require.resolve('socket.io-client/dist/socket.io.js.map'), dest: '.bin/node_modules/socket.io-client/dist' },
]
})
],
},
];