generated from eva-engine/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.dev.js
54 lines (52 loc) · 1.39 KB
/
rollup.config.dev.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
52
53
54
import path from 'path';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import serve from 'rollup-plugin-serve';
import livereload from 'rollup-plugin-livereload';
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';
const publicDir = path.resolve(__dirname, 'docs');
const exampleDir = path.resolve(__dirname, 'example');
export default {
input: 'example/index.ts',
output: {
file: 'docs/bundle.js',
format: 'iife',
globals: {
'pixi.js': 'PIXI',
},
},
external: ['pixi.js'],
plugins: [
globals(),
builtins(),
resolve({
browser: true,
mainFields: ['jsnext', 'esnext', 'module', 'main'],
}),
commonjs(),
typescript({
typescript: require('typescript'),
check: false,
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
cacheRoot: path.resolve(__dirname, 'node_modules/.rts2_cache'),
objectHashIgnoreUnknownHack: true,
tsconfigOverride: {
compilerOptions: {
sourceMap: false,
declaration: false,
declarationMap: false,
},
exclude: ['**/__tests__'],
},
}),
serve({
open: true,
contentBase: publicDir,
host: 'localhost',
port: 8080,
}),
livereload(exampleDir),
],
};