-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack-back.config.mjs
56 lines (53 loc) · 1.12 KB
/
webpack-back.config.mjs
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
import webpack from 'webpack';
import path from 'node:path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default {
entry: path.resolve(__dirname, './app.js'),
output: {
path: path.resolve(__dirname, './dist'),
filename: 'back.cjs',
},
target: 'node',
module: {
rules: [
{
test: /\.ya?ml$/,
use: 'yaml-loader',
},
{
test: /\.njk$/,
type: 'asset/source',
},
{
test: /\.raw.js$/,
type: 'asset/source',
},
{
test: /\.svg$/,
type: 'asset/source',
},
{
test: /\.css$/,
type: 'asset/source',
},
{
test: /\.png$/,
type: 'asset/inline',
},
],
},
plugins: [
new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true }),
new webpack.IgnorePlugin({
resourceRegExp: /^fsevents$/,
}),
],
resolve: {
extensions: ['.js'],
alias: {
front: path.resolve(__dirname, './dist/front.raw.js'), // Chemin vers le bundle front
},
},
mode: 'development',
};