0.2.2 • Published 3 years ago

@tractorzoom/webpack-config v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@tractorzoom/webpack-config

Extendable webpack configuration

Publish Status

Installation
npm i --save-dev @tractorzoom/webpack-config
Usage

Extend configuration in webpack.config.js

// First build your handlers object (name to path map)
const handlers = {
    hello: './src/handlers/hello.ts'
}

module.exports = require('@tractorzoom/webpack-config')(handlers)
Scripts

Add build and clean scripts to package.json to build your webpack bundles.

{
    "scripts": {
        "build": "npm run clean && webpack",
        "clean": "rimraf build"
    }
}
Other Configurations

You may need to update your cloudformation template

Globals:
    Function:
        Runtime: nodejs12.x

# old
Handler: src/handlers/hello.handler

# new
Globals:
    Function:
        CodeUri: build/
        Runtime: nodejs12.x

Handler: hello.handler

If you are deploying with SAM, you will need to update your CI

# old
-   name: SAM build
    uses: TractorZoom/sam-cli-action@master
    with:
    sam_command: 'build'

# new
-   name: Build
    run: |
        npm ci
        npm run build
0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago