41 lines
770 B
JavaScript
41 lines
770 B
JavaScript
const path = require('path');
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
module.exports = {
|
|
entry: './src/index.jsx',
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'bundle.js',
|
|
clean: true,
|
|
},
|
|
resolve: {
|
|
extensions: ['.js', '.jsx'],
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.jsx?$/,
|
|
exclude: /node_modules/,
|
|
use: 'babel-loader',
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ['style-loader', 'css-loader', 'postcss-loader'],
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: './src/index.html',
|
|
}),
|
|
],
|
|
devServer: {
|
|
port: 3000,
|
|
proxy: [
|
|
{
|
|
context: ['/api'],
|
|
target: 'http://localhost:8001',
|
|
},
|
|
],
|
|
},
|
|
};
|