forked from rollup/rollup
/
_config.js
39 lines (37 loc) · 918 Bytes
/
_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
const path = require('path');
const MagicString = require('magic-string');
module.exports = {
description: 'error after transform should throw with correct location of file',
options: {
plugins: [
{
transform(source, id) {
const s = new MagicString(source);
s.prepend("import _assign from 'object-assign';\n");
return {
code: s.toString(),
map: s.generateMap({ hires: true })
};
}
}
]
},
error: {
code: 'MISSING_EXPORT',
message: `'default' is not exported by empty.js, imported by main.js`,
pos: 44,
watchFiles: [path.resolve(__dirname, 'main.js'), path.resolve(__dirname, 'empty.js')],
loc: {
file: path.resolve(__dirname, 'main.js'),
line: 1,
column: 7
},
frame: `
1: import a from './empty.js';
^
2:
3: Object.assign({}, a);
`,
url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`
}
};