cra-template-node-express
Version:
You can use the template using the below command.
39 lines (37 loc) • 821 B
JavaScript
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: [
'webpack-hot-middleware/client',
'react-hot-loader/patch',
'./src/client/index.js'
],
output: {
path: path.join(__dirname,'..','..', '/dist'),
filename: 'main.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader']
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: './src/client/index.html'
})
],
mode: process.env.NODE_ENV || 'development',
devtool: 'inline-source-map'
};