-
Notifications
You must be signed in to change notification settings - Fork 15
/
webpack.config.js
37 lines (35 loc) · 1.07 KB
/
webpack.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
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const { NODE_ENV = 'production' } = process.env;
const webpackConfigDir = dirname(fileURLToPath(import.meta.url));
export default /** @type {import('webpack').Configuration} */ ({
mode: NODE_ENV,
entry: {
main: './assets/js/main.js',
contact: './assets/js/contact.js',
contact_us_form_element: './assets/js/contact_us_form_element.ts',
faqs: './assets/js/faqs.js',
partners_contact: './assets/js/partners/contact.js',
touchpoints: ['./assets/js/touchpoints_translations.js', './assets/js/touchpoints_58f51d4d.js'],
country_support: './assets/js/country_support.js',
post_office_search: './assets/js/post_office_search.tsx',
},
target: ['web'],
output: {
filename: '[name].js',
path: `${webpackConfigDir}/_site/assets/js`,
},
resolve: {
extensions: ['.js', '.ts', '.tsx'],
},
module: {
rules: [
{
test: /\.[jt]sx?$/,
exclude: /node_modules/,
use: ['babel-loader'],
},
],
},
devtool: 'source-map',
});