Skip to content

configure sam build --watch support #39

@asankagit

Description

@asankagit

I use aws-sam-webpack-plugin with webpack to build the files.

webpack.config.js

const AwsSamPlugin = require("aws-sam-webpack-plugin");
const awsSamPlugin = new AwsSamPlugin();
const path = require('path');

module.exports = {
    //entry: './app.js',
    entry: () => awsSamPlugin.entry(),
    output: {
      path: path.resolve("."),
      filename: (chunkData) => awsSamPlugin.filename(chunkData),
      libraryTarget: 'commonjs'
    },
    target: 'node',
    mode: 'production',

      // Add the AWS SAM Webpack plugin
    plugins: [awsSamPlugin]

}

instead of using sam buld I use npm run build
in package.json

....
 "scripts": {
    "test": "mocha tests/unit/",
    "build": "webpack --watch "
  },
.....

although webpack rebuild the changes, it does not appear when sam local start-api
is running,
I am looking help for configure to appear changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions