forked from rollup/rollup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_config.js
28 lines (27 loc) · 805 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
const commonjs = require('@rollup/plugin-commonjs');
const resolve = require('@rollup/plugin-node-resolve').default;
module.exports = {
description: 'confirm preserveModulesRoot restructures src appropriately',
expectedWarnings: ['MIXED_EXPORTS'],
options: {
input: ['src/under-build.js', 'src/below/module.js'],
plugins: [
{
name: 'convert-slashes',
// This simulates converted slashes as used by e.g. Vite
async resolveId(source, importer, options) {
const resolved = await this.resolve(source, importer, { ...options, skipSelf: true });
return { ...resolved, id: resolved.id.replace(/\\/g, '/') };
}
},
resolve({
moduleDirectories: ['custom_modules']
}),
commonjs()
],
output: {
preserveModules: true,
preserveModulesRoot: 'src'
}
}
};