redux-devtools/packages/redux-devtools-slider-monitor/examples/todomvc/webpack.config.ts

50 lines
1.1 KiB
TypeScript

import * as path from 'path';
import * as webpack from 'webpack';
module.exports = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./index',
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
},
module: {
rules: [
{
test: /\.(js|ts)x?$/,
use: ['babel-loader'],
exclude: /node_modules/,
include: __dirname,
},
{
test: /\.css?$/,
use: [
'style-loader',
{
loader: 'raw-loader',
options: {
esModule: false,
},
},
],
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
plugins: [new webpack.HotModuleReplacementPlugin()],
devServer: {
contentBase: path.join(__dirname, 'dist'),
host: 'localhost',
port: process.env.PORT || 3000,
historyApiFallback: true,
hot: true,
},
devtool: 'eval-source-map',
};