-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.config.js
42 lines (34 loc) · 890 Bytes
/
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
const ESLintWebpackPlugin = require('eslint-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
const ROOT = __dirname;
module.exports = {
devtool: 'source-map',
entry: [path.resolve(ROOT, 'DEV_ONLY', 'index.tsx')],
mode: 'development',
module: {
rules: [
{
include: [path.resolve(ROOT, 'src'), path.resolve(ROOT, 'DEV_ONLY')],
loader: 'babel-loader',
test: /\.(js|ts|tsx)$/,
},
],
},
output: {
filename: 'react-style-tag.js',
library: 'Style',
libraryTarget: 'umd',
path: path.resolve(ROOT, 'dist'),
umdNamedDefine: true,
},
plugins: [
new webpack.EnvironmentPlugin(['NODE_ENV']),
new HtmlWebpackPlugin(),
new ESLintWebpackPlugin(),
],
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
};