Skip to content

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

_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