2020-11-02 09:51:40 +08:00

24 lines
596 B
JavaScript

const webpack = require('webpack');
const log = require('../helpers/log');
const createProdConfig = require('../configs/webpack.config');
const generateRoute = require('./route');
function startBuild(config) {
try {
generateRoute(config);
const webpackConfig = createProdConfig(config, webpack, 'build');
webpack(webpackConfig, (err) => {
if (err) {
log.error(err);
return;
}
console.log('[build] success');
});
} catch (e) {
log.error(e);
}
}
module.exports = startBuild;