-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
39 lines (37 loc) · 1.04 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
import path from 'path';
import typescript from 'rollup-plugin-typescript2';
const base = (input, outputDir, extension, format) => ({
input,
preserveModules: true,
treeshake: false,
output: {
format,
dir: outputDir,
entryFileNames: c => {
const filename = path.basename(c.facadeModuleId);
const file = filename.split('.');
file[file.length - 1] = extension;
return file.join('');
}
},
watch: {
include: './**',
exclude: [
'node_modules',
'**/*.spec.ts'
],
clearScreen: false
},
plugins: [
typescript({
tsconfig: 'tsconfig.rollup-build.json',
useTsconfigDeclarationDir: true
}),
],
});
module.exports = [
base('./src/index.ts', './dist', '.mjs', 'esm'),
base('./src/index.ts', './dist', '.js', 'commonjs'),
base('./src/locale/index.ts', './dist/locale', '.mjs', 'esm'),
base('./src/locale/index.ts', './dist/locale', '.js', 'commonjs'),
];