-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathrollup.config.js
More file actions
46 lines (42 loc) · 1.08 KB
/
rollup.config.js
File metadata and controls
46 lines (42 loc) · 1.08 KB
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
import autoExternal from 'rollup-plugin-auto-external';
import babel from 'rollup-plugin-babel';
import nodeResolve from 'rollup-plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import alias from '@rollup/plugin-alias';
import path from 'path';
import pkg from './package.json' with { type: "json" };
const extensions = ['.ts'];
export default {
input: 'src/index.ts',
output: [
{
file: 'dist/cjs/easy-template-x.cjs',
format: 'cjs'
},
{
file: 'dist/es/easy-template-x.mjs',
format: 'es'
}
],
plugins: [
alias({
entries: [{
find: 'src',
replacement: path.resolve(process.cwd(), 'src')
}]
}),
autoExternal(),
nodeResolve({
extensions
}),
replace({
// replace options
preventAssignment: true,
// keywords:
EASY_VERSION: JSON.stringify(pkg.version)
}),
babel({
extensions,
})
]
};