-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrolli.config.js
59 lines (56 loc) · 1.37 KB
/
rolli.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
import { defineConfig } from 'rolli'
import pkg from './package.json' assert { type: 'json' }
import {
generateModuleMeta,
generateModuleTypes,
logModuleTemplates,
} from './src/utils/templates.js'
export default defineConfig({
tsconfig: 'playground/.nuxt/tsconfig.json',
exports: false,
bin: false,
entries: [
// Module Core
{
input: './src/module.ts',
output: './dist/module.mjs',
externals: [/@nuxt/],
replace: {
preventAssignment: true,
__name__: pkg.name,
__version__: pkg.version,
},
},
{
input: './src/types/module.ts',
output: './dist/module.d.ts',
},
// Runtime Plugin
{
input: './src/runtime/plugin.ts',
output: './dist/runtime/plugin.mjs',
externals: ['#app', 'animejs'],
},
{
input: './src/types/runtime/plugin.ts',
output: './dist/runtime/plugin.d.ts',
},
// Runtime Composables
{
input: './src/runtime/composables/index.ts',
output: './dist/runtime/composables/index.mjs',
externals: ['animejs'],
},
{
input: './src/types/runtime/composables/index.ts',
output: './dist/runtime/composables/index.d.ts',
},
],
hooks: {
'rolli:end': async () => {
await generateModuleMeta(pkg.name, pkg.version)
await generateModuleTypes()
logModuleTemplates()
},
},
})