Skip to content

Commit

Permalink
Cambios en ts loader para evitar problema con la recarga de los archi…
Browse files Browse the repository at this point in the history
…vos.

- Agrega tsconfig.
- Agrega webpack-fail plugin para propagar error cuando se presente uno (https://github.com/TypeStrong/ts-loader#failing-the-build-on-typescript-compilation-error).
  • Loading branch information
jhovanyamaya committed Feb 24, 2017
1 parent d28cb60 commit 47d3813
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
"rx": "^4.1.0"
},
"devDependencies": {
"awesome-typescript-loader": "^3.0.4",
"json-loader": "^0.5.4",
"source-map-loader": "^0.1.6",
"ts-loader": "^2.0.1",
"typescript": "^2.1.6",
"webpack": "^2.2.1",
"webpack-dev-server": "^2.4.1"
"webpack-dev-server": "^2.4.1",
"webpack-fail-plugin": "^1.0.5"
},
"config": {}
}
10 changes: 10 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"noImplicitAny": false,
"module": "commonjs",
"target": "es5",
"allowJs": true
}
}
29 changes: 20 additions & 9 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
const path = require('path');
const failPlugin = require('webpack-fail-plugin');

module.exports = {
entry: "./src/index.ts",
entry: './src/index.ts',

output: {
filename: "./dist/bundle.js",
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
libraryTarget: "umd",
library: "kafkaesque-ui"

},

devtool: "source-map",
resolve: {
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"]
},

module: {
loaders: [
{ test: /\.tsx?$/, loader: "awesome-typescript-loader" },
{ test: /\.json$/, loader: 'json' }
rules: [
{test: /\.tsx?$/, loader: 'ts-loader', exclude: /node_modules/}
]
}
},

resolve: {
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js']
},

plugins: [
failPlugin
]
};

0 comments on commit 47d3813

Please sign in to comment.