80 lines
2.2 KiB
JavaScript
80 lines
2.2 KiB
JavaScript
const Path = require('path');
|
|
const Webpack = require('webpack');
|
|
const WebpackMerge = require('webpack-merge');
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
const configBase = require('./webpack.config.base.js');
|
|
|
|
module.exports = WebpackMerge(configBase, {
|
|
entry: {
|
|
app: [
|
|
]
|
|
},
|
|
|
|
devtool: 'inline-source-map',
|
|
|
|
devServer: {
|
|
hot: true,
|
|
inline: true,
|
|
historyApiFallback: true,
|
|
publicPath: '/', // match the output `publicPath`
|
|
contentBase: [__dirname + '/public', __dirname + '/dist', __dirname + '/node_modules'], // match the output path
|
|
host: '127.0.0.1',
|
|
port: 9093,
|
|
stats: {
|
|
colors: true
|
|
},
|
|
watchOptions: {
|
|
// ignored: [ Path.resolve(__dirname, '../../node_modules/') ],
|
|
ignored: /node_modules/,
|
|
aggregateTimeout: 300,
|
|
poll: 1000
|
|
},
|
|
},
|
|
|
|
module: {
|
|
rules: [
|
|
{
|
|
enforce: 'pre',
|
|
test: /\.js$/,
|
|
loader: 'source-map-loader',
|
|
exclude: [
|
|
Path.resolve(__dirname, '../../node_modules/')
|
|
]
|
|
},
|
|
{
|
|
enforce: 'pre',
|
|
test: /\.tsx?$/,
|
|
use: "source-map-loader",
|
|
exclude: [
|
|
Path.resolve(__dirname, '../../node_modules/')
|
|
]
|
|
},
|
|
{
|
|
test: /\.tsx?$/,
|
|
loaders: [
|
|
'awesome-typescript-loader'
|
|
],
|
|
exclude: [
|
|
Path.resolve(__dirname, '../../node_modules/')
|
|
],
|
|
include: [
|
|
Path.resolve(__dirname, '../../src/')
|
|
]
|
|
},
|
|
]
|
|
},
|
|
plugins: [
|
|
new Webpack.HotModuleReplacementPlugin(),
|
|
new Webpack.NamedModulesPlugin(),
|
|
new Webpack.NoEmitOnErrorsPlugin(),
|
|
new HtmlWebpackPlugin({
|
|
template: Path.resolve(__dirname, '../../public/index.html')
|
|
}),
|
|
new Webpack.optimize.CommonsChunkPlugin({
|
|
name: 'vendor',
|
|
minChunks: Infinity,
|
|
filename: 'vendor.js'
|
|
}),
|
|
]
|
|
});
|