Skip to content

Commit

Permalink
Merge pull request #626 from serverless-heaven/fix/update-examples
Browse files Browse the repository at this point in the history
Update all examples
  • Loading branch information
miguel-a-calles-mba authored Aug 4, 2020
2 parents 8167ca7 + 7d4c09b commit de2e5fa
Show file tree
Hide file tree
Showing 48 changed files with 26,886 additions and 22,701 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ install:
- npm --version

test_script:
- npm test
- npm run test

# Don't actually build.
build: off
14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,27 @@ os: linux
dist: xenial
language: node_js

# avoid double Travis build when the PR is created on upstream
if: |
type = pull_request OR \
branch = master
jobs:
include:
- node_js: '10'
- node_js: '12'
env: COVERAGE=run

install:
- travis_retry npm install

script:
- npm run eslint
- npm test
- if [[ $COVERAGE = run ]]; then npm run test-coverage ; fi;
- if [[ $COVERAGE = '' ]]; then npm run test ; fi;

after_success:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
- |
if [[ $COVERAGE = run ]]; then
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
fi
18 changes: 10 additions & 8 deletions examples/babel-multiple-statically-entries/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/\*
## WARNING!

* WARNING!
*
* This example is only there to show that you _can_ overtake the configuration
* manually. This is _strongly discouraged_ since serverless-webpack V3 as it
* does not work with individual packaging of functions and prevents you to
* use optimizations like Webpack's tree shaking.
\*/
This example is only there to show that you _can_ overtake the configuration
manually. This is *strongly discouraged* since serverless-webpack V3 as it
does not work with individual packaging of functions and prevents you to
use optimizations like Webpack's tree shaking.

You can also try to invoke a function locally:
```
serverless invoke local --function=first --path=./event.json
```
8 changes: 0 additions & 8 deletions examples/babel-multiple-statically-entries/WARNING

This file was deleted.

4 changes: 0 additions & 4 deletions examples/babel-multiple-statically-entries/first.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if (!global._babelPolyfill) {
require('babel-polyfill');
}

export const hello = (event, context, cb) => {
const p = new Promise((resolve, reject) => {
resolve('success');
Expand Down
16 changes: 9 additions & 7 deletions examples/babel-multiple-statically-entries/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
"author": "Nicola Peduzzi <thenikso@gmail.com> (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"
"@babel/core": "^7.10.5",
"@babel/plugin-transform-runtime": "^7.10.5",
"@babel/preset-env": "^7.10.4",
"babel-loader": "^8.1.0",
"babel-plugin-source-map-support": "^2.1.2",
"serverless": "^1.77.1",
"serverless-offline": "^6.5.0",
"serverless-webpack": "file:../..",
"webpack": "^4.44.1"
}
}
4 changes: 0 additions & 4 deletions examples/babel-multiple-statically-entries/second.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if (!global._babelPolyfill) {
require('babel-polyfill');
}

export const hello = (event, context, cb) => {
const p = new Promise((resolve, reject) => {
resolve('success');
Expand Down
2 changes: 1 addition & 1 deletion examples/babel-multiple-statically-entries/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins:

provider:
name: aws
runtime: nodejs6.10
runtime: nodejs12.x

# Individual packaging MUST NOT be enabled as we use static entry definitions!
# package:
Expand Down
2 changes: 2 additions & 0 deletions examples/babel-multiple-statically-entries/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const path = require('path');
const slsw = require('serverless-webpack');

module.exports = {
entry: {
first: ['./first.js'],
second: ['./second.js']
},
target: 'node',
mode: slsw.lib.webpack.isLocal ? 'development': 'production',
module: {
rules: [
{
Expand Down
Loading

0 comments on commit de2e5fa

Please sign in to comment.