franz
franz generates you serverless.yml
and webpack config.
Still in early stage!!
define a lambda.config.js
file and call franz
.
Now you could call webpack
with your webpack config. And finally serverless deploy
module.exports = {
service: 'service_name',
region: 'eu-central-1',
stage: 'dev',
variables: {
FOO: 'bar',
BAR: process.env.BAR
},
functions: [
'./path/to/your/function',
]
}
your function file:
module.exports = {
name: 'my-function',
method: 'GET',
path: '/foo',
handler: function (request) {
return Promise.resolve({foo: 'bar'})
}
}
wbepack.config.js
const config = require('./webpack.json')
module.exports = Object.assign(config, {
module: {
rules: [{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}]
}
})