Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all examples #626

Merged
merged 2 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we run builds on master to make sure it build properly? Some repositories treat master as unstable, but not sure whether we are doing that for this repo.


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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thanks!


# 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