-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.examples.js
37 lines (34 loc) · 1.04 KB
/
webpack.config.examples.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const path = require('path');
const merge = require('webpack-merge');
const config = require('./webpack.config');
const HtmlWebPackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = merge(config, {
mode: 'development',
output: {
path: path.join(__dirname, 'dist/examples'),
filename: `react-light-components-examples.js`,
chunkFilename: '[name]-bundle.js',
},
entry: './examples/index.tsx',
devtool: 'source-map',
plugins: [
new CleanWebpackPlugin(),
new MiniCssExtractPlugin({
filename: '[name].css',
}),
new HtmlWebPackPlugin({
template: './examples/index.html',
filename: 'index.html'
}),
new BundleAnalyzerPlugin({ analyzerPort: 8800, openAnalyzer: false })
],
devServer: {
inline: true,
port: 8000,
contentBase: './dist/examples',
open: true
}
});