/
rollup.config.js
105 lines (101 loc) · 2.17 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
var path = require('path');
function relative(id) {
if (id[0] !== '/') return id;
if (id[0] !== '\\') return id;
return './' + path.relative(process.cwd(), id);
}
module.exports = {
input: 'main.js',
cache: {
modules: [
{
id: './e.js',
ast: {
type: 'Program',
start: 0,
end: 18,
body: [
{
type: 'ExpressionStatement',
start: 0,
end: 17,
expression: {
type: 'CallExpression',
start: 0,
end: 16,
callee: {
type: 'MemberExpression',
start: 0,
end: 11,
object: {
type: 'Identifier',
start: 0,
end: 7,
name: 'console'
},
property: {
type: 'Identifier',
start: 8,
end: 11,
name: 'log'
},
computed: false,
optional: false
},
arguments: [
{
type: 'Literal',
start: 12,
end: 15,
value: 'e',
raw: "'e'"
}
],
optional: false
}
}
],
sourceType: 'module'
},
code: "console.log('e');\n",
dependencies: [],
customTransformCache: false,
originalCode: "console.log('e');\n",
originalSourcemap: null,
resolvedIds: {},
sourcemapChain: [],
transformDependencies: []
}
]
},
plugins: [
{
name: 'buggy-plugin',
resolveId(id) {
if (id.includes('\0')) return;
// this action will never resolve or reject
if (id.endsWith('c.js')) return new Promise(() => {});
return relative(id);
},
load(id) {
// this action will never resolve or reject
if (id.endsWith('b.js')) return new Promise(() => {});
},
transform(code, id) {
// this action will never resolve or reject
if (id.endsWith('a.js')) return new Promise(() => {});
},
moduleParsed({ id }) {
// this action will never resolve or reject
if (id.endsWith('d.js')) return new Promise(() => {});
},
shouldTransformCachedModule({ id }) {
// this action will never resolve or reject
if (id.endsWith('e.js')) return new Promise(() => {});
}
}
],
output: {
format: 'es'
}
};