Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
pass sourcemap option to plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Jul 30, 2019
1 parent 6cac027 commit 10b386b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
7 changes: 0 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@
"minNodeVersion": 8
}
],
[
"@pika/plugin-simple-bin",
{
"bin": "pack",
"minNodeVersion": 8
}
]
]
},
"publishConfig": {
Expand Down
14 changes: 7 additions & 7 deletions src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type Flags = {
force?: boolean;
};


export function hasWrapper(commander: Object, args: Array<string>): boolean {
return true;
}
Expand Down Expand Up @@ -51,6 +50,7 @@ export class Build {
const outPretty = path.relative(cwd, out) + path.sep;

const manifest = await config.manifest;
const {sourcemap} = manifest['@pika/pack'] || {sourcemap: false};
const distRunners = await config.getDistributions();
const builderConfig: Partial<BuilderOptions> = {
out,
Expand Down Expand Up @@ -92,7 +92,7 @@ export class Build {
if (runner.validate) {
const result = await runner.validate({
...builderConfig,
options,
options: {sourcemap, ...options},
});
if (result instanceof Error) {
throw result;
Expand All @@ -109,7 +109,7 @@ export class Build {
await (runner.beforeBuild &&
runner.beforeBuild({
...builderConfig,
options,
options: {sourcemap, ...options},
}));
}
});
Expand All @@ -132,17 +132,17 @@ export class Build {
await (runner.beforeJob &&
runner.beforeJob({
...builderConfig,
options,
options: {sourcemap, ...options},
}));
await (runner.build &&
runner.build({
...builderConfig,
options,
options: {sourcemap, ...options},
}));
await (runner.afterJob &&
runner.afterJob({
...builderConfig,
options,
options: {sourcemap, ...options},
}));
} catch (err) {
if (flags.force) {
Expand Down Expand Up @@ -172,7 +172,7 @@ export class Build {
await (runner.afterBuild &&
runner.afterBuild({
...builderConfig,
options,
options: {sourcemap, ...options},
}));
}

Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ function findProjectRoot(base: string): string {
return base;
}


export async function cli(args: string[]) {
const version = getVersion();
loudRejection();
Expand Down

0 comments on commit 10b386b

Please # to comment.