forked from rollup/rollup
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_config.js
34 lines (34 loc) · 780 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
module.exports = defineTest({
description: "allows to use amd.autoId with amd.basePath and works when concat'd into one file",
options: {
input: ['main'],
output: {
amd: {
autoId: true,
basePath: 'some/where'
}
},
plugins: [
{
name: 'concatenate-amd',
generateBundle(options, bundle) {
if (options.format === 'amd') {
const concatenatedCode = Object.keys(bundle)
.map(chunkName => bundle[chunkName].code)
.join('\n');
for (const chunkName of Object.keys(bundle)) {
delete bundle[chunkName];
}
this.emitFile({ type: 'asset', fileName: 'main.js', source: concatenatedCode });
}
}
}
]
},
nestedDir: 'some/where',
runAmd: {
exports(exports) {
return exports.getA();
}
}
});