-
Notifications
You must be signed in to change notification settings - Fork 210
/
webpack.config.test.js
55 lines (54 loc) · 1.34 KB
/
webpack.config.test.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
51
52
53
54
55
const HtmlBundlerPlugin = require('html-bundler-webpack-plugin');
const path = require('node:path');
module.exports = {
mode: 'development',
output: {
path: path.join(__dirname, 'examples/dist'),
library: {
name: 'ReactCheckboxTree',
type: 'umd',
},
},
resolve: {
extensions: ['.js', '.jsx'],
alias: {
'react-checkbox-tree': path.resolve(__dirname, 'src/index.js'),
},
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
},
{
test: /\.s[ac]ss$/i,
use: [
'css-loader',
'sass-loader',
],
},
],
},
devServer: {
open: true,
static: {
directory: path.join(__dirname, 'examples/dist'),
},
watchFiles: ['src/**/*', 'examples/src/**/*'],
},
plugins: [
new HtmlBundlerPlugin({
entry: {
index: 'examples/src/index.html',
},
js: {
filename: '[name].[contenthash:8].js',
},
css: {
filename: '[name].[contenthash:8].css',
},
}),
],
};