/
_config.js
57 lines (56 loc) · 1.92 KB
/
_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
const { assertIncludes } = require('../../../utils.js');
module.exports = {
description: 'warns about import and export related issues',
command: 'rollup -c',
stderr: stderr => {
assertIncludes(
stderr,
'(!) Mixing named and default exports\n' +
'https://rollupjs.org/guide/en/#outputexports\n' +
'The following entry modules are using named and default exports together:\n' +
'main.js\n' +
'\n' +
"Consumers of your bundle will have to use chunk['default'] to access their default export, which may not be what you want. Use `output.exports: 'named'` to disable this warning\n"
);
assertIncludes(
stderr,
'(!) Unused external imports\n' +
`default imported from external module "external" but never used in "main.js"\n`
);
assertIncludes(
stderr,
'(!) Import of non-existent export\n' +
'main.js\n' +
"1: import unused from 'external';\n" +
"2: import * as dep from './dep.js';\n" +
"3: import alsoUnused from './dep.js';\n" +
' ^\n' +
"4: import 'unresolvedExternal';\n"
);
assertIncludes(
stderr,
'(!) Missing exports\n' +
'https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module\n' +
'main.js\n' +
'missing is not exported by dep.js\n' +
"4: import 'unresolvedExternal';\n" +
'5: \n' +
'6: export const missing = dep.missing;\n' +
' ^\n' +
'7: export default 42;\n'
);
assertIncludes(
stderr,
'(!) Conflicting re-exports\n' +
'"main.js" re-exports "foo" from both "dep.js" and "dep2.js" (will be ignored)\n' +
'"main.js" re-exports "bar" from both "dep.js" and "dep2.js" (will be ignored)\n'
);
assertIncludes(
stderr,
'(!) Unresolved dependencies\n' +
'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency\n' +
'unresolvedExternal (imported by main.js, dep.js)\n' +
'otherUnresolvedExternal (imported by dep.js)\n'
);
}
};