forked from OptimistikSAS/OIBus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.frontend.js
More file actions
52 lines (50 loc) · 1.35 KB
/
webpack.frontend.js
File metadata and controls
52 lines (50 loc) · 1.35 KB
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
const path = require('node:path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ESLintPlugin = require('eslint-webpack-plugin')
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
module.exports = {
entry: ['./src/frontend/index.jsx'],
output: {
path: path.resolve(__dirname, 'build', 'web-client'),
publicPath: '/',
filename: 'bundle.js',
},
resolve: {
alias: {
'react-dom$': 'react-dom/profiling',
'scheduler/tracing': 'scheduler/tracing-profiling',
},
fallback: { path: require.resolve('path-browserify') },
},
devtool: 'source-map',
module: {
rules: [
{
test: /\.(js|jsx)$/i,
exclude: /node_modules/,
use: ['babel-loader'],
},
{
test: /\.(css)$/i,
// creates style nodes from JS strings and translates CSS into CommonJS
use: ['style-loader', 'css-loader'],
},
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/inline',
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: 'asset/resource',
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve('./src/frontend/index.html'),
favicon: path.resolve('./src/frontend/favicon.ico'),
}),
new ESLintPlugin(),
new MonacoWebpackPlugin({ languages: ['json', 'sql'] }),
],
}