This repository was archived by the owner on Oct 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
51 lines (50 loc) · 1.47 KB
/
webpack.config.js
File metadata and controls
51 lines (50 loc) · 1.47 KB
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
46
47
48
49
50
51
const webpack = require('webpack');
// noinspection WebpackConfigHighlighting
module.exports = {
entry: './src/index.js',
output: {
path: __dirname,
filename: 'index.js',
libraryTarget: 'commonjs2'
},
module: {
rules: [
{
test: /\.js$/,
include: __dirname,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
}
}
]
},
plugins: [
new webpack.BannerPlugin({ banner: "#!/usr/bin/env node", raw: true })
],
externals: {
'cli': 'cli',
'jest': 'jest',
'chalk': 'chalk',
'webpack': 'webpack',
'webpack-dev-server': 'webpack-dev-server',
'html-webpack-plugin': 'html-webpack-plugin',
'rollup': 'rollup',
'rollup-plugin-babel': 'rollup-plugin-babel',
'rollup-plugin-terser': 'rollup-plugin-terser',
'react': 'commonjs react',
'react-dom': 'react-dom',
'prop-types': 'prop-types',
'@material-ui/core': '@material-ui/core',
'@material-ui/styles': '@material-ui/styles',
'@material-ui/icons': '@material-ui/icons'
},
// weird hack based on:
// https://github.com/webpack-contrib/css-loader/issues/447
node: {
fs: 'empty'
}
};