mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 11:17:41 +00:00
feat(@vant/cli): using vite to build packages
This commit is contained in:
@@ -1,16 +1,6 @@
|
||||
import webpack from 'webpack';
|
||||
import { getPackageConfig } from '../config/webpack.package';
|
||||
import { build } from 'vite';
|
||||
import { getViteConfigForPackage } from '../config/vite.config.package';
|
||||
|
||||
export async function compilePackage(isMinify: boolean) {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const config = getPackageConfig(isMinify);
|
||||
|
||||
webpack(config, (err, stats) => {
|
||||
if (err || (stats?.hasErrors())) {
|
||||
reject(err || stats?.toString());
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
export async function compilePackage(minify: boolean) {
|
||||
return build(getViteConfigForPackage(minify));
|
||||
}
|
||||
|
Reference in New Issue
Block a user