const Path = require('path'); const TsConfigPathsPlugin = require('awesome-typescript-loader').TsConfigPathsPlugin; module.exports = { target: 'web', output: { path: Path.resolve(__dirname, '../../dist'), filename: '[name].js', publicPath: '/' }, devtool: '', resolve: { extensions: ['.ts', '.tsx', '.js', '.json'], // Fix webpack's default behavior to not load packages with jsnext:main module // https://github.com/Microsoft/TypeScript/issues/11677 mainFields: ['browser', 'main'], plugins: [ new TsConfigPathsPlugin({ tsconfig: "tsconfig.json", compiler: "typescript" }) ] }, module: { rules:[ { test: /\.tsx?$/, exclude: [ Path.resolve(__dirname, '../../node_modules/') ], enforce: 'pre', use: [ { loader: 'tslint-loader' } ] }, { test: /\.html$/, use: [ { loader: 'html-loader' } ] }, { test: /\.png$/, use: [ { loader: 'url-loader?limit=10000' } ] }, { test: /\.jpg$/, use: [ { loader: 'file-loader' } ] } ] }, plugins: [ ], node: { // workaround for webpack-dev-server issue // https://github.com/webpack/webpack-dev-server/issues/60#issuecomment-103411179 fs: 'empty', net: 'empty' } };