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

17 lines
413 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 && stats.hasErrors())) {
reject();
} else {
resolve();
}
});
});
}