Merge pull request #4913 from mlecoq/updateTypescriptTemplate

upgrade typescript, types, node and webpack for typescript template
This commit is contained in:
Frank Schmid 2018-05-12 13:10:01 +02:00 committed by GitHub
commit 2bd3f1f0ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 22 deletions

View File

@ -10,13 +10,14 @@
"source-map-support": "^0.5.0"
},
"devDependencies": {
"@types/aws-lambda": "0.0.22",
"@types/aws-lambda": "8.10.1",
"@types/node": "^8.0.57",
"serverless-webpack": "^4.0.0",
"ts-loader": "^2.3.7",
"typescript": "^2.5.2",
"webpack": "^3.6.0"
"serverless-webpack": "^5.1.1",
"ts-loader": "^4.2.0",
"typescript": "^2.8.1",
"webpack": "^4.5.0"
},
"author": "The serverless webpack authors (https://github.com/elastic-coders/serverless-webpack)",
"author":
"The serverless webpack authors (https://github.com/elastic-coders/serverless-webpack)",
"license": "MIT"
}

View File

@ -7,7 +7,7 @@ plugins:
provider:
name: aws
runtime: nodejs6.10
runtime: nodejs8.10
functions:
hello:

View File

@ -1,10 +1,11 @@
{
"compilerOptions": {
"sourceMap": true,
"target": "es6",
"lib": [
"es5",
"es2015.promise"
]
"esnext"
],
"moduleResolution": "node"
},
"exclude": [
"node_modules"

View File

@ -3,21 +3,16 @@ const slsw = require('serverless-webpack');
const entries = {};
Object.keys(slsw.lib.entries).forEach(key => (
entries[key] = ['./source-map-install.js', slsw.lib.entries[key]]
));
Object.keys(slsw.lib.entries).forEach(
key => (entries[key] = ['./source-map-install.js', slsw.lib.entries[key]])
);
module.exports = {
mode: slsw.lib.webpack.isLocal ? 'development' : 'production',
entry: entries,
devtool: 'source-map',
resolve: {
extensions: [
'.js',
'.jsx',
'.json',
'.ts',
'.tsx'
]
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
},
output: {
libraryTarget: 'commonjs',
@ -26,8 +21,9 @@ module.exports = {
},
target: 'node',
module: {
loaders: [
{ test: /\.ts(x?)$/, loader: 'ts-loader' },
rules: [
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{ test: /\.tsx?$/, loader: 'ts-loader' },
],
},
};