-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.dist.js
50 lines (47 loc) · 1.31 KB
/
webpack.dist.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
46
47
48
49
50
/* eslint-disable */
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const paths = {
lib: path.resolve(__dirname, '.'),
entry: path.resolve(__dirname, './index'),
output: path.resolve(__dirname, './dist'),
};
module.exports = {
mode: 'production',
entry: paths.entry,
output: {
filename: 'index.js',
path: paths.output,
libraryTarget: 'umd'
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
symlinks: true,
},
module: {
rules: [
{
use: {
loader: 'babel-loader',
options: {
cacheDirectory: true,
babelrc: false,
presets: [
'@babel/preset-env',
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: [
'@babel/plugin-proposal-class-properties',
],
},
},
test: /\.(tsx?)|(jsx?)$/,
include: [paths.lib],
},
],
},
plugins: [
new CleanWebpackPlugin(),
],
};