Skip to content

Commit

Permalink
feat: Build command to add checkRequiredFiles option.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Nov 6, 2019
1 parent a9560ce commit 3c02827
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kkt",
"version": "5.0.0-alpha.3",
"version": "5.0.0-alpha.5",
"description": "Create React apps with no build configuration, Cli tool for creating react apps.",
"author": "Kenny Wong <wowohoo@qq.com> (https://github.com/jaywcjlove)",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/command/build/handlerBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default async (args: IMyYargsArgs) => {
// Generate configuration
const config = await configFactory('production', args);
// Warn and crash if required files are missing
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
if (args.checkRequiredFiles && !checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
process.exit(1);
}

Expand Down
4 changes: 4 additions & 0 deletions src/command/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export function builder(yarg: IMyYargsArgs) {
describe: 'Empty the DIST directory before compiling.',
default: true,
},
checkRequiredFiles: {
describe: 'Warn and crash if required files are missing.',
default: true,
}
})
.example('$ kkt build ', 'Build your project.')
.example('$ kkt build --no-emptyDir', 'Build your project.');
Expand Down
2 changes: 1 addition & 1 deletion src/config/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function getAdditionalModulePaths(options: ModulePathOptions = {}) {
throw new Error(
color.red.bold(
"Your project's `baseUrl` can only be set to `src` or `node_modules`." +
' Create React App does not support other values at this time.'
' KKT does not support other values at this time.'
)
);
}
Expand Down

0 comments on commit 3c02827

Please sign in to comment.