You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hydro/build/index.js

21 lines
572 B
JavaScript

const fs = require('fs');
const root = require('./root');
const ignoreFailure = require('./ignoreFailure');
5 years ago
async function build(type) {
if (!['development', 'production'].includes(type)) throw new Error(`Unknown type: ${type}`);
ignoreFailure(fs.mkdirSync, root('.build'));
await require('./locales')(type);
await require('./buildModule')(type);
await require('./buildTemplate')(type);
await require('./webpack')(type);
5 years ago
}
module.exports = build;
if (!module.parent) {
build('development').catch((e) => {
console.error(e);
});
}