-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
116 lines (115 loc) · 2.29 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import commonjs from '@rollup/plugin-commonjs'
import buble from '@rollup/plugin-buble'
import vue from 'rollup-plugin-vue'
import typescript from 'rollup-plugin-typescript2'
import { terser } from 'rollup-plugin-terser'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import pkg from './package.json'
export default [
{
input: './src/index.ts',
output: {
file: `./dist/cjs/${pkg.name.split('/')[1]}.js`,
sourceMap: 'inline',
format: 'cjs',
},
plugins: [
terser(),
typescript({
rootDir: 'src',
declaration: true,
}),
],
},
{
input: './src/plugin.ts',
output: {
file: `./dist/cjs/plugin.js`,
sourceMap: 'inline',
format: 'cjs',
},
plugins: [
typescript({
rootDir: 'src',
declaration: true,
}),
vue({
compileTemplate: true,
}),
buble(),
],
},
{
input: './src/index.ts',
output: {
file: `./dist/esm/${pkg.name.split('/')[1]}.js`,
sourceMap: 'inline',
format: 'esm',
},
plugins: [
terser(),
typescript({
rootDir: 'src',
declaration: true,
}),
],
},
{
input: './src/plugin.ts',
output: {
file: `./dist/esm/plugin.js`,
sourceMap: 'inline',
format: 'esm',
},
plugins: [
typescript({
rootDir: 'src',
declaration: true,
}),
vue({
compileTemplate: true,
}),
buble(),
],
},
{
input: './src/index.ts',
output: {
file: `./dist/umd/${pkg.name.split('/')[1]}.js`,
name: 'nuxtSpearlyCmsModule',
format: 'umd',
},
plugins: [
terser(),
nodeResolve({
rootDir: 'src',
declaration: true,
}),
commonjs(),
typescript(),
],
},
// {
// input: './src/plugin.ts',
// output: {
// file: `./dist/umd/plugin.js`,
// name: 'nuxtSpearlyCmsModulePlugin',
// format: 'umd',
// },
// plugins: [
// vue({
// compileTemplate: true,
// }),
// nodeResolve({
// rootDir: 'src',
// declaration: true,
// }),
// commonjs(),
// typescript(),
// buble({
// transforms: { dangerousForOf: true }
// }),
// ],
// ete
// },
]