-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.js
45 lines (43 loc) · 1.03 KB
/
webpack.config.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
38
39
40
41
42
43
44
45
const { resolve } = require('path');
const webpack = require('webpack');
// const HtmlWebpackPlugin = require('html-webpack-plugin');
const baseConfig = {
entry: './src/index.jsx',
// devtool: 'inline-source-map',
// devServer: {
// hot: true,
// contentBase: 'build',
// publicPath: '/',
// stats: 'errors-only',
// },
output: {
path: resolve('./build'),
filename: 'index.js',
libraryTarget: 'commonjs2',
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node-modules/,
},
],
},
// plugins: [
// new HtmlWebpackPlugin({
// title: 'Title',
// template: './src/index.html',
// minify: { useShortDoctype: true },
// hash: false,
// }),
// ],
externals: {
react: 'react', // this line is just to use the React dependency of our parent-testing-project instead of using our own React.
},
resolve: {
extensions: ['.js', '.jsx'],
modules: ['node_modules'],
},
};
module.exports = baseConfig;