2017-12-18 08:06:05 +00:00
|
|
|
const Path = require('path');
|
|
|
|
const TsConfigPathsPlugin = require('awesome-typescript-loader').TsConfigPathsPlugin;
|
|
|
|
|
|
|
|
module.exports = {
|
2017-12-21 05:48:31 +00:00
|
|
|
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: {
|
|
|
|
loaders: [
|
|
|
|
{
|
|
|
|
enforce: 'pre',
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
exclude: [
|
|
|
|
Path.resolve(__dirname, '../../node_modules/')
|
|
|
|
],
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'tslint-loader'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
],
|
|
|
|
|
|
|
|
node: {
|
|
|
|
// workaround for webpack-dev-server issue
|
|
|
|
// https://github.com/webpack/webpack-dev-server/issues/60#issuecomment-103411179
|
|
|
|
fs: 'empty',
|
|
|
|
net: 'empty'
|
|
|
|
}
|
2017-12-18 08:06:05 +00:00
|
|
|
};
|