vant/packages/vant-cli/src/compiler/compile-package.ts
2020-12-21 17:15:26 +08:00

17 lines
429 B
TypeScript

import webpack from 'webpack';
import { getPackageConfig } from '../config/webpack.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();
}
});
});
}