Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat| Added support for custom build directory #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fsmawi
Copy link

@fsmawi fsmawi commented Jun 23, 2021

The plugin doesn't work properly with a Typescript project. It uses the wrong path to the function file.
To fix this issue I added an option to specify the build directory.

sls step-functions-offline --stateMachine=FirstLambda --event={{path to event file}} --buildDir=.webpack/build

@@ -17,7 +17,8 @@ module.exports = {
// },
//
_findFunctionPathAndHandler(functionHandler) {
const dir = path.dirname(functionHandler);
const buildDir = this.options.buildDir ? `${this.options.buildDir}/` : '';
const dir = `${buildDir}${path.dirname(functionHandler)}`;
Copy link

@ryanolee ryanolee Aug 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth making this configurable from the custom: config object also? (Or possibly under something like )

stepFunctions:
    build:
         path: './webpack/some/path'

So it does not have to be entered from the CLI / scripts all the time 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants