Skip to content

Instantly share code, notes, and snippets.

@Umkus
Last active May 26, 2021 06:49
Show Gist options
  • Save Umkus/aff9f1de2f1c17dbd645caf6660e8633 to your computer and use it in GitHub Desktop.
Save Umkus/aff9f1de2f1c17dbd645caf6660e8633 to your computer and use it in GitHub Desktop.
.projenrc.js updated build task
const {
TypeScriptProject,
ProjectType,
} = require('projen');
const project = new TypeScriptProject({
defaultReleaseBranch: 'main',
name: 'projen',
buildWorkflow: false,
releaseWorkflow: false,
pullRequestTemplate: false,
deps: [
'express',
],
devDeps: [
'webpack',
'webpack-cli',
'ts-loader',
],
description: 'Projen demo',
packageName: 'projen-demo',
projectType: ProjectType.APP,
});
// Updating existing pre-configured tasks
project.buildTask.reset();
project.buildTask.exec('npx projen'); // Synthesize project files
project.buildTask.exec('npx projen test'); // Run tests
project.buildTask.exec('npx webpack'); // Bundle the code
project.watchTask.reset();
project.watchTask.exec('npx webpack --watch'); // Continuously bundle the code
// Adding an extra custom task
project.addTask('What time is it?', {
description: 'Prints current system time',
exec: 'date',
category: '30.maintain',
});
project.synth();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment