mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Merge pull request #4913 from mlecoq/updateTypescriptTemplate
upgrade typescript, types, node and webpack for typescript template
This commit is contained in:
commit
2bd3f1f0ef
@ -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"
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ plugins:
|
||||
|
||||
provider:
|
||||
name: aws
|
||||
runtime: nodejs6.10
|
||||
runtime: nodejs8.10
|
||||
|
||||
functions:
|
||||
hello:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"sourceMap": true,
|
||||
"target": "es6",
|
||||
"lib": [
|
||||
"es5",
|
||||
"es2015.promise"
|
||||
]
|
||||
"esnext"
|
||||
],
|
||||
"moduleResolution": "node"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
|
||||
@ -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' },
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user