Last active
May 26, 2021 06:49
-
-
Save Umkus/aff9f1de2f1c17dbd645caf6660e8633 to your computer and use it in GitHub Desktop.
.projenrc.js updated build task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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