Implemented scripts for building and releasing grafana/ui

This commit is contained in:
Dominik Prokop
2019-02-21 15:06:29 +01:00
parent 72e269c8f3
commit 529c1ea53d
17 changed files with 684 additions and 44 deletions
+41
View File
@@ -0,0 +1,41 @@
import concurrently from 'concurrently';
import { Task } from '..';
interface StartTaskOptions {
watchThemes: boolean;
hot: boolean;
}
const startTask: Task<StartTaskOptions> = async ({ watchThemes, hot }) => {
const jobs = [];
if (watchThemes) {
jobs.push({
command: 'nodemon -e ts -w ./packages/grafana-ui/src/themes -x yarn run themes:generate',
name: 'SASS variables generator',
});
}
if (!hot) {
jobs.push({
command: 'webpack --progress --colors --watch --mode development --config scripts/webpack/webpack.dev.js',
name: 'Webpack',
});
} else {
jobs.push({
command: 'webpack-dev-server --progress --colors --mode development --config scripts/webpack/webpack.hot.js',
name: 'Dev server',
});
}
try {
await concurrently(jobs, {
killOthers: ['failure', 'failure'],
});
} catch (e) {
console.error(e);
process.exit(1);
}
};
export default startTask;