mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-05 03:05:07 +08:00
24 lines
596 B
JavaScript
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;
|