forked from 4site-interactive-studios/engrid-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
executable file
·129 lines (128 loc) · 3.47 KB
/
webpack.common.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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
const path = require("path");
var HtmlWebpackPlugin = require("html-webpack-plugin");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
module.exports = {
entry: {
main: "./src/themes/" + process.env.npm_package_client + "/index.ts",
},
plugins: [
new ForkTsCheckerWebpackPlugin(),
new HtmlWebpackPlugin({
title: "Engaging Networks - Page Type Selection",
template: "./src/index.html",
inject: true,
minify: {
removeComments: true,
collapseWhitespace: false,
},
}),
new HtmlWebpackPlugin({
title: "Engaging Networks Page - Donation",
filename: "page-donation.html",
template: "./src/templates/page-donation.html",
inject: true,
minify: {
removeComments: true,
collapseWhitespace: false,
},
}),
new HtmlWebpackPlugin({
title: "Oxfam US - Engaging Networks Page - Donation",
filename: "page-donation-oxfamus.html",
template: "./src/templates/page-donation-oxfamus.html",
inject: true,
minify: {
removeComments: true,
collapseWhitespace: false,
},
}),
new HtmlWebpackPlugin({
title: "Ocean Conservancy - Engaging Networks Page - Donation",
filename: "page-donation-oc.html",
template: "./src/templates/page-donation-oc.html",
inject: true,
minify: {
removeComments: true,
collapseWhitespace: false,
},
}),
new HtmlWebpackPlugin({
title: "RFK HR - Engaging Networks Page - Donation",
filename: "page-donation-rfkhr.html",
template: "./src/templates/page-donation-rfkhr.html",
inject: true,
minify: {
removeComments: true,
collapseWhitespace: false,
},
}),
new HtmlWebpackPlugin({
title: "Ocean Conservancy - Engaging Networks Page - Donation",
filename: "page-donation-applepay.html",
template: "./src/templates/page-donation-applepay.html",
inject: true,
minify: {
removeComments: true,
collapseWhitespace: false,
},
}),
new HtmlWebpackPlugin({
title: "Engaging Networks Page - Sign Up",
filename: "page-sign-up.html",
template: "./src/templates/page-sign-up.html",
inject: true,
minify: {
removeComments: true,
collapseWhitespace: false,
},
}),
new HtmlWebpackPlugin({
title: "Engaging Networks Email - eCard",
filename: "email-ecard.html",
template: "./src/templates/email-ecard.html",
inject: true,
minify: {
removeComments: true,
collapseWhitespace: false,
},
}),
],
module: {
rules: [
{
test: /\.(svg|png|jpg|gif)$/,
use: {
loader: "file-loader",
options: {
name: "[name].[hash].[ext]",
outputPath: "imgs",
},
},
},
{
test: /\.(ts|js)x?$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/env", "@babel/preset-typescript"],
plugins: [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread",
"@babel/plugin-transform-runtime",
],
},
},
},
{
test: /\.(html)$/,
use: {
loader: "html-loader",
},
},
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
};