-
-
Notifications
You must be signed in to change notification settings - Fork 535
Expand file tree
/
Copy pathwebpack.config.js
More file actions
108 lines (106 loc) · 3.41 KB
/
webpack.config.js
File metadata and controls
108 lines (106 loc) · 3.41 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
mode: isProduction ? 'production' : 'development',
entry: {
'calendar-event-editor': './webpack/calendar-event-editor.js',
'two-factor-enrollment': './webpack/two-factor-enrollment.js',
churchcrm: './webpack/skin-main',
'churchcrm-rtl': './webpack/skin-rtl',
'photo-uploader': './webpack/photo-uploader-entry',
'root-dashboard': './webpack/root-dashboard',
setup: './webpack/setup',
'family-register': './webpack/family-register',
'family-verify': './webpack/family-verify',
'upgrade-wizard': './webpack/upgrade-wizard',
'locale-loader': './webpack/locale-loader',
backup: './webpack/backup',
restore: './webpack/restore',
'csv-import': './webpack/csv-import',
'admin-dashboard': './webpack/admin-dashboard',
'get-started': './webpack/get-started',
'church-info': './webpack/church-info',
'system-settings-panel': './webpack/system-settings-panel',
'kiosk-registration-closed': './webpack/kiosk-registration-closed',
kiosk: './webpack/kiosk',
'people-list': './webpack/people/person-list',
'people-family-list': './webpack/people/family-list',
'people-family-view': './webpack/people/family-view',
'people-person-view': './webpack/people/person-view',
'groups-sundayschool-dashboard': './webpack/groups-sundayschool-dashboard',
'groups-sundayschool-class-view': './webpack/groups-sundayschool-class-view',
'repeat-event-editor': './webpack/repeat-event-editor',
'event-checkin': './webpack/event-checkin',
'event-calendars': './webpack/event-calendars',
'event-types': './webpack/event-types',
'event-editor': './webpack/event-editor',
'event-types-list': './webpack/event-types-list',
'event-cart-to-event': './webpack/event-cart-to-event',
},
output: {
path: path.resolve('./src/skin/v2'),
filename: '[name].min.js',
publicPath: 'auto',
},
externals: {
// Leaflet is loaded as a global from skin/external/leaflet/leaflet.js (Grunt-copied).
// Mapping it here lets webpack entries import 'leaflet' without bundling it.
leaflet: 'L',
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
alias: {
jquery: path.resolve(__dirname, 'node_modules/jquery'),
},
},
cache: {
type: 'filesystem',
buildDependencies: {
config: [__filename],
},
},
devtool: isProduction ? false : 'eval-cheap-module-source-map',
optimization: {
moduleIds: 'deterministic',
chunkIds: 'deterministic',
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
},
{
test: /\.(sa|sc|c)ss$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
url: {
filter: (url) => {
return !url.startsWith('/') && !url.startsWith('data:');
},
},
},
},
'sass-loader',
],
},
{
test: /\.(woff2?|ttf|eot|svg|png|jpg|gif)$/,
type: 'asset/resource',
generator: {
filename: 'assets/[name].[contenthash][ext]',
},
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name].min.css',
ignoreOrder: false,
}),
],
};