Skip to content

Commit

Permalink
fix: static copy (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
echosoar committed Aug 19, 2020
1 parent a19a143 commit c572b04
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/faas-cli-plugin-invoke/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export class FaaSInvokePlugin extends BasePlugin {

private async copyStaticFile() {
const isTsMode = checkIsTsMode();
if (isTsMode || this.skipTsBuild) {
if (isTsMode || this.skipTsBuild || !this.analyzedTsCodeRoot) {
return;
}
return copyStaticFiles({
Expand Down
3 changes: 3 additions & 0 deletions packages/faas-cli-plugin-package/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ export class PackagePlugin extends BasePlugin {
return;
}
const tsCodeRoot: string = this.getTsCodeRoot();
if (!tsCodeRoot) {
return;
}
return copyStaticFiles({
sourceDir: tsCodeRoot,
targetDir: join(this.midwayBuildPath, 'dist'),
Expand Down
3 changes: 3 additions & 0 deletions packages/faas-code-analysis/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ export const innerTsConfigMaker = (options: InnerTsConfigOptions) => {
};

export const copyStaticFiles = async ({ sourceDir, targetDir, log }) => {
if (!sourceDir || !targetDir) {
return;
}
const paths = globby.sync(['**/*.*'], {
cwd: sourceDir,
followSymbolicLinks: false,
Expand Down

0 comments on commit c572b04

Please sign in to comment.