-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration with deploy package function (#130)
* Deploy package function * Listen pipe and reject pipe errors * using once instead of on * Fix babel example * - Adding babel-multiple-statically-entries example - Renaming multiple-entries-example to multiple-statically-entries * Exposing entries to lib * Adding babel-dynamically-entries examples * - Updating examples dependencies - Adding yarn to examples - Fix typescript example * Adding tests * Removed yarn lock file. yarn should use package-lock.json * Allow handlers in arbitrary paths. Use lodash and SLS functions. * Adapted unit tests * Mention new entry resolution in README * Bundle names now contain the js ending. Fixed output in examples.
- Loading branch information
1 parent
b87f028
commit 22a460d
Showing
39 changed files
with
16,510 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
node_modules | ||
dist | ||
.webpack | ||
.serverless | ||
coverage | ||
|
||
.idea | ||
|
||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
if (!global._babelPolyfill) { | ||
require('babel-polyfill'); | ||
} | ||
|
||
export const hello = (event, context, cb) => { | ||
const p = new Promise((resolve, reject) => { | ||
resolve('success'); | ||
}); | ||
p | ||
.then(r => cb(null, { | ||
message: 'Go Serverless Webpack (Babel) v1.0! First module!', | ||
event, | ||
})) | ||
.catch(e => cb(e)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "serverless-webpack-babel-example", | ||
"version": "1.0.0", | ||
"description": "Serverless webpack example using Babel", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "Nicola Peduzzi <[email protected]> (http://nikso.net)", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"babel-core": "^6.25.0", | ||
"babel-loader": "^7.1.1", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-polyfill": "^6.23.0", | ||
"babel-preset-env": "^1.6.0", | ||
"serverless-webpack": "file:../../", | ||
"webpack": "^3.3.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
if (!global._babelPolyfill) { | ||
require('babel-polyfill'); | ||
} | ||
|
||
export const hello = (event, context, cb) => { | ||
const p = new Promise((resolve, reject) => { | ||
resolve('success'); | ||
}); | ||
p | ||
.then(r => cb(null, { | ||
message: 'Go Serverless Webpack (Babel) v1.0! Second module!', | ||
event, | ||
})) | ||
.catch(e => cb(e)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
service: babel-dynamically-entries-example | ||
|
||
# Add the serverless-webpack plugin | ||
plugins: | ||
- serverless-webpack | ||
|
||
provider: | ||
name: aws | ||
runtime: nodejs4.3 | ||
|
||
functions: | ||
first: | ||
handler: first.hello | ||
events: | ||
- http: | ||
method: get | ||
path: first | ||
integration: lambda | ||
second: | ||
handler: second.hello | ||
events: | ||
- http: | ||
method: get | ||
path: second | ||
integration: lambda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const path = require('path'); | ||
const slsw = require('serverless-webpack'); | ||
|
||
module.exports = { | ||
entry: slsw.lib.entries, | ||
target: 'node', | ||
module: { | ||
loaders: [{ | ||
test: /\.js$/, | ||
loaders: ['babel-loader'], | ||
include: __dirname, | ||
exclude: /node_modules/, | ||
}] | ||
}, | ||
output: { | ||
libraryTarget: 'commonjs', | ||
path: path.join(__dirname, '.webpack'), | ||
filename: '[name]' | ||
} | ||
}; |
Oops, something went wrong.