Files
react/examples/tree-shaking-webpack/webpack.config.js
witt 34b26223f8 chore: update GH's template and prettier config (#309)
* chore(gh): update GitHub's pull-request template

* chore: use unified common prettier config

* chore: add the mdx file to prettier

* chore(gh): update contributing guide docs
2020-07-02 21:59:29 +08:00

39 lines
671 B
JavaScript

const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: './src/index.js',
devtool: 'source-map',
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader'],
},
],
},
resolve: {
extensions: ['.js', '.jsx'],
},
output: {
path: __dirname + '/dist',
publicPath: '/',
filename: 'bundle.js',
},
plugins: [new HtmlWebpackPlugin({ template: path.join(__dirname, './src/index.html') })],
devServer: {
host: '127.0.0.1',
port: '3000',
contentBase: './dist',
hot: true,
open: true,
},
}