-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.dev.config.js
60 lines (57 loc) · 1.35 KB
/
webpack.dev.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import path from 'path';
import HtmlWebPackPlugin from 'html-webpack-plugin';
import { fileURLToPath } from 'node:url'
import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
import ESLintPlugin from 'eslint-webpack-plugin';
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
const config = {
devtool: 'inline-source-map',
mode: 'development',
entry: path.resolve(dirname, 'demo/index.tsx'),
output: {
filename: 'demo.bundle.js',
path: path.resolve(dirname, 'demo'),
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
transpileOnly: true,
compilerOptions: {
module: "ESNext",
moduleResolution: "node",
}
},
}
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
alias: {
'@faceless-ui/modal': path.resolve(dirname, 'src/index.ts'),
},
extensionAlias: {
'.js': ['.ts', '.js', '.tsx', '.jsx'],
'.mjs': ['.mts', '.mjs'],
},
},
plugins: [
new ReactRefreshWebpackPlugin(),
new HtmlWebPackPlugin({
template: 'demo/index.html',
}),
new ESLintPlugin({
fix: true,
emitWarning: true,
}),
],
devServer: {
port: 3000,
host: '0.0.0.0',
hot: true,
},
};
export default config;