franz
v0.6.1
Published
Create webpack and serverless config files from your lambda definitions
Downloads
9
Readme
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', //used by serverless
region: 'eu-central-1', //used by serverless
stage: 'dev', //used by serverless
variables: { //global environment variables for your lambda functions
FOO: 'bar',
BAR: process.env.BAR
},
functions: [
'./path/to/your/function', //with or without .js -> uses require() internally
]
}
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('./dist/webpack.json') //contains all entry points...
module.exports = Object.assign(config, {
module: {
rules: [{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}]
}
})