Skip to content

Commit

Permalink
feat(ngm): added --skip-bundles flage to build options
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin committed Dec 15, 2016
1 parent 5acddf5 commit dd67956
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/ngm/bin/ngm-cli.ts
Expand Up @@ -30,10 +30,10 @@ const cli = meow(`
--no-local Use version numbers from local submodules when building package.json,
usually needed only for publish command
-w, --watch Watch input files
--verbose Enable verbose mode
--verbose Enable verbose mode
--clean Cleaning dist folders
It removes folder, so you will need to rerun commands like 'link', etc...
--skip-bundles Works only in --watch mode, allows to skip umd bundling
----------------------------------------------------------------
link - runs 'npm link' in each submodule dist folder
Expand Down
11 changes: 6 additions & 5 deletions src/ngm/commands/build.command.ts
Expand Up @@ -8,7 +8,7 @@ const del = require('del');
import { buildPkgs, findSubmodules, tasksWatch } from 'npm-submodules';
import { build, bundleUmd } from '../tasks';

export function buildCommand({project, verbose, clean, local, main, watch}) {
export function buildCommand({project, verbose, clean, local, main, watch, skipBundles}) {
// 1. clean dist folders
// 2.1 merge pkg json
// todo: 2.2 validate pkg (main, module, types fields)
Expand Down Expand Up @@ -62,7 +62,8 @@ export function buildCommand({project, verbose, clean, local, main, watch}) {
minify: false
})
}))
)
),
skip: () => watch && skipBundles
},
{
title: 'Bundling minified umd version',
Expand All @@ -79,15 +80,15 @@ export function buildCommand({project, verbose, clean, local, main, watch}) {
})
}))
),
skip: () => watch
skip: () => watch || skipBundles
},

], {renderer: verbose ? 'verbose' : 'default'}));
}

export function buildTsRun(cli) {
const {project, watch, verbose, clean, local} = cli.flags;
const {project, watch, verbose, clean, local, skipBundles} = cli.flags;
let main = cli.flags.main || 'index.ts';
return buildCommand({project, verbose, clean, local, main, watch})
return buildCommand({project, verbose, clean, local, main, watch, skipBundles})
.then(tasks => tasksWatch({project, tasks, watch}));
}

0 comments on commit dd67956

Please sign in to comment.