-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathwebpack.dev.js
47 lines (43 loc) · 922 Bytes
/
webpack.dev.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
/* eslint-disable import/no-extraneous-dependencies
*/
const path = require('path');
const webpack = require('webpack');
const { merge } = require('webpack-merge');
const common = require('./webpack.common');
const config = merge(common, {
entry: {
demo: './example/index.tsx',
},
output: {
path: path.resolve(__dirname, 'example/'),
filename: '[name].js',
},
devServer: {
static: './example',
compress: true,
port: 9966,
hot: true,
},
devtool: 'eval',
module: {
rules: [
{
test: /\.(txt|mdx?)$/i,
type: 'asset/source',
},
],
},
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
}),
],
resolve: {
fallback: {
fs: require.resolve('browserify-fs'),
path: require.resolve('path-browserify'),
stream: require.resolve('stream-browserify'),
},
},
});
module.exports = config;