ui-lib/vite.build.js

39 lines
752 B
JavaScript

import { build } from "vite";
import postcssPresetEnv from "postcss-preset-env";
const libraries = [
{
clearScreen: false,
css: {
postcss: {
plugins: [postcssPresetEnv()]
}
},
build: {
lib: {
entry: './lib/ui.js',
name: 'lib-ui',
formats: ['umd'],
fileName: (_format, name) => `${name}.min.js`
},
sourcemap: true,
emptyOutDir: false
}
},
{
clearScreen: false,
build: {
lib: {
entry: './lib/utility.js',
name: 'lib-utility',
formats: ['umd'],
fileName: (_format, name) => `${name}.min.js`
},
sourcemap: true,
emptyOutDir: false
}
}
]
libraries.forEach(async b => await build(b))