deprecated_overflow_webapp/config/webpack/webpack.config.base.js

79 lines
1.5 KiB
JavaScript
Raw Permalink Normal View History

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: {
2017-12-26 10:09:30 +00:00
rules:[
2017-12-21 05:48:31 +00:00
{
test: /\.tsx?$/,
exclude: [
Path.resolve(__dirname, '../../node_modules/')
],
2017-12-26 10:09:30 +00:00
enforce: 'pre',
2017-12-21 05:48:31 +00:00
use: [
{
loader: 'tslint-loader'
}
2017-12-26 10:09:30 +00:00
]
},
{
test: /\.html$/,
use: [
{
loader: 'html-loader'
}
]
},
{
test: /\.png$/,
use: [
{
loader: 'url-loader?limit=10000'
}
]
},
{
test: /\.jpg$/,
use: [
{
loader: 'file-loader'
}
]
2017-12-21 05:48:31 +00:00
}
]
},
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
};