1 |
|
2 | import typescript from '@rollup/plugin-typescript';
|
3 | import resolve from '@rollup/plugin-node-resolve';
|
4 | import replace from '@rollup/plugin-replace';
|
5 | import commonjs from '@rollup/plugin-commonjs';
|
6 | import unassert from 'rollup-plugin-unassert';
|
7 | import json from '@rollup/plugin-json';
|
8 | import {terser} from 'rollup-plugin-terser';
|
9 | import minifyStyleSpec from './rollup_plugin_minify_style_spec';
|
10 | import strip from '@rollup/plugin-strip';
|
11 | import {Plugin} from 'rollup';
|
12 |
|
13 |
|
14 |
|
15 | export const nodeResolve = resolve({
|
16 | browser: true,
|
17 | preferBuiltins: false
|
18 | });
|
19 |
|
20 | export const plugins = (production: boolean): Plugin[] => [
|
21 | minifyStyleSpec(),
|
22 | json(),
|
23 |
|
24 | replace({
|
25 | preventAssignment: true,
|
26 | include: /\/jsonlint-lines-primitives\/lib\/jsonlint.js/,
|
27 | delimiters: ['', ''],
|
28 | values: {
|
29 | '_token_stack:': ''
|
30 | }
|
31 | }),
|
32 | production && strip({
|
33 | sourceMap: true,
|
34 | functions: ['PerformanceUtils.*', 'Debug.*']
|
35 | }),
|
36 | production && terser({
|
37 | compress: {
|
38 |
|
39 | pure_getters: true,
|
40 | passes: 3
|
41 | }
|
42 | }),
|
43 | production && unassert({
|
44 | include: ['** |
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
\ | No newline at end of file |