deprecated_overflow_webapp/config/webpack/webpack.config.base.js
crusader cf40d0998e ing
2017-12-21 14:48:31 +09:00

62 lines
1.3 KiB
JavaScript

const Path = require('path');
const TsConfigPathsPlugin = require('awesome-typescript-loader').TsConfigPathsPlugin;
const packages = require('../../package.json');
module.exports = {
target: 'web',
entry: {
webapp: [
Path.resolve(__dirname, '../../src/ts/@overflow/webapp/index.tsx')
],
vendor: Object.keys(packages.dependencies)
},
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'
}
};