vant/packages/vant-cli/src/compiler/compile-package.ts

17 lines
396 B
TypeScript

import webpack from 'webpack';
import { getPackageConfig } from '../config/webpack.package';
export async function compilePackage(isMinify: boolean) {
return new Promise((resolve, reject) => {
const config = getPackageConfig(isMinify);
webpack(config, (err, stats) => {
if (err || stats.hasErrors()) {
reject();
} else {
resolve();
}
});
});
}