-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.config.ts
31 lines (27 loc) · 914 Bytes
/
build.config.ts
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
import fs from 'fs-extra'
import sass from 'sass'
import { defineBuildConfig } from 'unbuild'
export default defineBuildConfig({
entries: [
{ builder: 'mkdist', input: './src', pattern: ['**/*.vue'], loaders: ['vue'] },
{ builder: 'mkdist', input: './src', pattern: ['**/*.ts'], format: 'cjs', loaders: ['js'] },
{ builder: 'mkdist', input: './src', pattern: ['**/*.ts'], format: 'esm', loaders: ['js'] },
],
hooks: {
'mkdist:done': () => {
const compiledSass = sass.compile('./src/sass/formkit-primevue.scss', { style: 'compressed', loadPaths: ['./node_modules/'] })
fs.writeFileSync(
'dist/style.css',
compiledSass.css,
{ encoding: 'utf-8' },
)
fs.mkdirSync('dist/sass')
fs.copyFileSync(
'src/sass/formkit-primevue.scss',
'dist/sass/formkit-primevue.scss',
)
},
},
declaration: true,
clean: true,
})