Skip to content

Commit

Permalink
feat(package): updated umd bundler options
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin committed Oct 2, 2017
1 parent e5a263d commit 03769f2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
35 changes: 19 additions & 16 deletions src/ngm/commands/build.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function buildCommand({project, verbose, clean, local, main, watch, skipB
task: () => new Listr(
opts.map(opt => ({
title: `Cleaning ${opt.dist}`,
task: () => del([opt.dist + '/**', '!' + opt.dist])
task: () => del(path.join(opt.dist, '**/*'))
}))
),
skip: () => !clean
Expand All @@ -38,8 +38,11 @@ export function buildCommand({project, verbose, clean, local, main, watch, skipB
task: () => Promise.all(opts.map(opt =>
cpy(['*.md', 'LICENSE'], opt.dist)
.then(() =>
cpy([path.join(opt.src, '*.md'),
path.join(opt.src, 'LICENSE')], opt.dist))
cpy([
path.join(opt.src, '*.md'),
path.join(opt.src, 'LICENSE')
],
opt.dist))
))
},
{
Expand Down Expand Up @@ -89,6 +92,7 @@ export function buildCommand({project, verbose, clean, local, main, watch, skipB
},
{
title: 'Copy assets to dist folder',
skip: () => true,
task: () => new Listr(
opts.map(opt => ({
title: `Copying ${opt.pkg.name} assets to ${opt.src}`,
Expand All @@ -105,31 +109,22 @@ export function buildCommand({project, verbose, clean, local, main, watch, skipB
}))
)
},
{
title: 'Clean .tmp folders',
task: () => new Listr(
opts.map(opt => ({
title: `Cleaning ${opt.tmp}`,
task: () => del(opt.tmp, {force: true})
}))
)
},
{
title: 'Bundling umd version',
task: () => new Listr(
opts.map(opt => ({
title: `Bundling ${opt.pkg.name}`,
task: () => bundleUmd({
main,
src: opt.src,
src: opt.tmp,
dist: opt.dist,
name: opt.pkg.name,
tsconfig: opt.tsconfig.path,
minify: false
})
}))
),
skip: () => watch && skipBundles
skip: () => watch || skipBundles
},
{
title: 'Bundling minified umd version',
Expand All @@ -138,7 +133,7 @@ export function buildCommand({project, verbose, clean, local, main, watch, skipB
title: `Bundling ${opt.pkg.name}`,
task: () => bundleUmd({
main,
src: opt.src,
src: opt.tmp,
dist: opt.dist,
name: opt.pkg.name,
tsconfig: opt.tsconfig.path,
Expand All @@ -147,8 +142,16 @@ export function buildCommand({project, verbose, clean, local, main, watch, skipB
}))
),
skip: () => watch || skipBundles
},
{
title: 'Clean .tmp folders',
task: () => new Listr(
opts.map(opt => ({
title: `Cleaning ${opt.tmp}`,
task: () => del(path.join(opt.tmp, '**/*'), {force: true})
}))
)
}

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

Expand Down
4 changes: 3 additions & 1 deletion src/ngm/models/webpack-umd.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ export function getWebpackConfig(config) {
exclude: [/\.e2e\.ts$/],
query: {
compilerOptions: {
declaration: false
declaration: false,
emitDecoratorMetadata: false
},
transpileOnly: true,
configFileName: config.tsconfig
}
},
Expand Down

0 comments on commit 03769f2

Please sign in to comment.