Skip to content

Instantly share code, notes, and snippets.

@darkyen
Created December 27, 2016 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darkyen/f5d0549f769d7159102b17c82fbf00fd to your computer and use it in GitHub Desktop.
Save darkyen/f5d0549f769d7159102b17c82fbf00fd to your computer and use it in GitHub Desktop.
Problem, everything gets compiled, files not even required.
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"sourceMap": true,
"alwaysStrict": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"jsx": "react"
},
"typeAcquisition": {
"enable": true
},
"exclude": [
"node_modules"
]
}
var fs = require('fs');
var webpack = require('webpack');
module.exports = {
entry: './src/test/webtask',
output: {
filename: 'main.js'
},
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: ['.ts', '.tsx', '.js']
},
module: {
rules: [
{
test: /\.tsx?$/,
use: {
loader: 'awesome-typescript-loader',
}
}
]
},
};
import Webtask from 'webtask-tools';
import * as Express from 'express';
const app : Express.Application = Express();
app.get('/', function index (req: Express.Request, res: Express.Response) : void {
res.json({
"hello": "world"
});
});
export default Webtask.fromExpress(app);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment