From becedbef97144863527bc830ce4f3665351346f9 Mon Sep 17 00:00:00 2001 From: Olivier Combe Date: Thu, 11 Feb 2016 23:50:28 +0100 Subject: [PATCH] chore: added awesome-typescript --- package.json | 3 ++- tsconfig.json | 10 ++++++++-- webpack.config.js | 7 +++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6ced2582..08c1fbc9 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "devDependencies": { "angular-cli": "0.0.*", "autoprefixer": "^6.3.2", + "awesome-typescript-loader": "^0.15.10", "copy-webpack-plugin": "^1.1.1", "css-loader": "^0.23.0", "extract-text-webpack-plugin": "^1.0.1", @@ -62,7 +63,7 @@ "tslint": "^3.3.0", "tslint-loader": "^2.1.0", "typedoc": "^0.3.12", - "typescript": "^1.7.3", + "typescript": "^1.7.5", "url-loader": "^0.5.6", "webpack": "^2.0.7-beta", "webpack-dev-server": "^2.0.0-beta" diff --git a/tsconfig.json b/tsconfig.json index 2f30ef7e..d3b9f5c4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,19 @@ { "compilerOptions": { "target": "ES5", + "module": "commonjs", "emitDecoratorMetadata": true, "experimentalDecorators": true, - "sourceMap": true + "sourceMap": true, + "moduleResolution": "node" }, "exclude": [ "node_modules" ], "compileOnSave": false, - "buildOnSave": false + "buildOnSave": false, + "awesomeTypescriptLoaderOptions": { + "useCache": true, + "forkChecker": true + } } diff --git a/webpack.config.js b/webpack.config.js index e11965fd..fde886d0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,6 +8,7 @@ var autoprefixer = require('autoprefixer'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var CopyWebpackPlugin = require('copy-webpack-plugin'); +var ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin; module.exports = function makeWebpackConfig(ENV) { /** @@ -80,7 +81,7 @@ module.exports = function makeWebpackConfig(ENV) { // Support for .ts files. { test: /\.ts$/, - loader: 'ts', + loader: 'awesome-typescript', query: { 'ignoreDiagnostics': [ 2403, // 2403 -> Subsequent variable declarations @@ -151,7 +152,9 @@ module.exports = function makeWebpackConfig(ENV) { 'process.env': { ENV: JSON.stringify(ENV) } - }) + }), + + new ForkCheckerPlugin() ];