-
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.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
14 changed files
with
10,134 additions
and
9,163 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
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,5 +1,4 @@ | ||
linters: | ||
"*.js": | ||
- "prettier-eslint --write" # Run Prettier | ||
- "eslint" # Run TSLint | ||
- "git add" | ||
"*.js": | ||
- "prettier-eslint --write" # Run Prettier | ||
- "eslint" # Run TSLint | ||
- "git add" |
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,13 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"node": "current" | ||
} | ||
} | ||
], | ||
["@babel/preset-typescript"] | ||
] | ||
} |
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,3 @@ | ||
node_modules | ||
.webpack | ||
.webpackCache |
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
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,18 +1,31 @@ | ||
service: serverless-webpack-typescript-example | ||
|
||
package: | ||
individually: true | ||
# Add the serverless-webpack plugin | ||
plugins: | ||
- serverless-webpack | ||
|
||
provider: | ||
name: aws | ||
runtime: nodejs6.10 | ||
runtime: nodejs10.x | ||
|
||
functions: | ||
hello: | ||
handler: handler.hello | ||
handler: src/handler.hello | ||
events: | ||
- http: | ||
method: get | ||
path: hello | ||
integration: lambda | ||
goodbye: | ||
handler: src/handler2.goodbye | ||
events: | ||
- http: | ||
method: get | ||
path: goodbye | ||
integration: lambda | ||
custom: | ||
webpack: | ||
webpackConfig: 'webpack.config.js' | ||
packager: 'yarn' | ||
includeModules: true |
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,3 @@ | ||
export const goodbye = (event, context, cb) => cb(null, | ||
{ message: 'Goodbye Serverless Webpack (Typescript) v1.0! Your function executed successfully!', event } | ||
); |
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,12 +1,17 @@ | ||
{ | ||
"compilerOptions": { | ||
"sourceMap": true, | ||
"lib": [ | ||
"es5", | ||
"es6", | ||
"dom", | ||
"es2015", | ||
"esnext.asynciterable" | ||
] | ||
"preserveConstEnums": true, | ||
"strictNullChecks": true, | ||
"inlineSources": true, | ||
"inlineSourceMap": true, | ||
"sourceRoot": "/", | ||
"target": "es2017", | ||
"outDir": ".build", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"esModuleInterop": true, | ||
"lib": ["es2017"], | ||
"rootDir": "./src", | ||
"resolveJsonModule": true | ||
} | ||
} |
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,32 +1,42 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const path = require('path'); | ||
const nodeExternals = require('webpack-node-externals'); | ||
const slsw = require('serverless-webpack'); | ||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); | ||
|
||
const isLocal = slsw.lib.webpack.isLocal; | ||
|
||
module.exports = { | ||
mode: isLocal ? 'development' : 'production', | ||
entry: slsw.lib.entries, | ||
externals: [nodeExternals()], | ||
devtool: 'source-map', | ||
resolve: { | ||
extensions: [ | ||
'.js', | ||
'.json', | ||
'.ts', | ||
'.tsx' | ||
] | ||
extensions: [ '.js', '.jsx', '.json', '.ts', '.tsx' ] | ||
}, | ||
output: { | ||
libraryTarget: 'commonjs', | ||
libraryTarget: 'commonjs2', | ||
path: path.join(__dirname, '.webpack'), | ||
filename: '[name].js' | ||
}, | ||
target: 'node', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts(x?)$/, | ||
// Include ts, tsx, js, and jsx files. | ||
test: /\.(ts|js)x?$/, | ||
exclude: /node_modules/, | ||
use: [ | ||
{ | ||
loader: 'ts-loader' | ||
} | ||
], | ||
loader: 'cache-loader', | ||
options: { | ||
cacheDirectory: path.resolve('.webpackCache') | ||
} | ||
}, | ||
'babel-loader' | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
plugins: [new ForkTsCheckerWebpackPlugin()] | ||
}; |
Oops, something went wrong.