1 |
www |
1 |
const path = require("path");
|
200 |
steven |
2 |
const isDevelopment = process.env.NODE_ENV === "development";
|
1 |
www |
3 |
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
|
4 |
const TerserPlugin = require("terser-webpack-plugin");
|
|
|
5 |
|
|
|
6 |
// Add paths while bundling
|
|
|
7 |
const paths = {
|
|
|
8 |
dashboard: {
|
|
|
9 |
entry: "./react-webpack/dashboard/components/index.js",
|
|
|
10 |
output: path.join(__dirname, "public/react-bundles/dashboard"),
|
|
|
11 |
filename: "dashboardBundle.js",
|
|
|
12 |
},
|
1307 |
steven |
13 |
notifications: {
|
|
|
14 |
entry: "./react-webpack/notifications/index.js",
|
170 |
steven |
15 |
output: path.join(__dirname, "public/react-bundles/dashboard"),
|
1307 |
steven |
16 |
filename: "notificationsBundle.js",
|
170 |
steven |
17 |
},
|
1 |
www |
18 |
myProfiles: {
|
|
|
19 |
entry: "./react-webpack/profile/my-profiles/my-profiles/index.js",
|
|
|
20 |
output: path.join(
|
|
|
21 |
__dirname,
|
|
|
22 |
"public/react-bundles/my-profiles/my-profiles"
|
|
|
23 |
),
|
|
|
24 |
filename: "myProfilesBundle.js",
|
|
|
25 |
},
|
|
|
26 |
peopleViewedProfile: {
|
|
|
27 |
entry: "./react-webpack/profile/people-viewed-profile/index.js",
|
|
|
28 |
output: path.join(
|
|
|
29 |
__dirname,
|
|
|
30 |
"public/react-bundles/profile/people-viewed-profile"
|
|
|
31 |
),
|
|
|
32 |
filename: "peopleViewedProfileBundle.js",
|
|
|
33 |
},
|
|
|
34 |
profileView: {
|
|
|
35 |
entry: "./react-webpack/profile/view/index.js",
|
|
|
36 |
output: path.join(__dirname, "public/react-bundles/profile/view"),
|
|
|
37 |
filename: "profileViewBundle.js",
|
|
|
38 |
},
|
|
|
39 |
profileEdit: {
|
|
|
40 |
entry: "./react-webpack/profile/my-profiles/edit/index.js",
|
|
|
41 |
output: path.join(__dirname, "public/react-bundles/profile/edit"),
|
|
|
42 |
filename: "profileEditBundle.js",
|
|
|
43 |
},
|
|
|
44 |
myConnections: {
|
|
|
45 |
entry: "./react-webpack/connection/my-connections/index.js",
|
|
|
46 |
output: path.join(
|
|
|
47 |
__dirname,
|
|
|
48 |
"public/react-bundles/connection/my-connections"
|
|
|
49 |
),
|
|
|
50 |
filename: "myConnectionsBundle.js",
|
|
|
51 |
},
|
|
|
52 |
invitationsReceived: {
|
|
|
53 |
entry: "./react-webpack/connection/invitations-received/index.js",
|
|
|
54 |
output: path.join(
|
|
|
55 |
__dirname,
|
|
|
56 |
"public/react-bundles/connection/invitations-received"
|
|
|
57 |
),
|
|
|
58 |
filename: "invitationsReceivedBundle.js",
|
|
|
59 |
},
|
|
|
60 |
invitationsSent: {
|
|
|
61 |
entry: "./react-webpack/connection/invitations-sent/index.js",
|
|
|
62 |
output: path.join(
|
|
|
63 |
__dirname,
|
|
|
64 |
"public/react-bundles/connection/invitations-sent"
|
|
|
65 |
),
|
|
|
66 |
filename: "invitationsSentBundle.js",
|
|
|
67 |
},
|
|
|
68 |
peopleYouMayKnow: {
|
|
|
69 |
entry: "./react-webpack/connection/people-you-may-know/index.js",
|
|
|
70 |
output: path.join(
|
|
|
71 |
__dirname,
|
|
|
72 |
"public/react-bundles/connection/people-you-may-know"
|
|
|
73 |
),
|
|
|
74 |
filename: "peopleYouMayKnowBundle.js",
|
|
|
75 |
},
|
|
|
76 |
peopleBlocked: {
|
|
|
77 |
entry: "./react-webpack/connection/people-blocked/index.js",
|
|
|
78 |
output: path.join(
|
|
|
79 |
__dirname,
|
|
|
80 |
"public/react-bundles/connection/people-blocked"
|
|
|
81 |
),
|
|
|
82 |
filename: "peopleBlockedBundle.js",
|
|
|
83 |
},
|
|
|
84 |
myCompanies: {
|
|
|
85 |
entry: "./react-webpack/company/my-companies/index.js",
|
|
|
86 |
output: path.join(__dirname, "public/react-bundles/my-companies"),
|
|
|
87 |
filename: "myCompaniesBundle.js",
|
|
|
88 |
},
|
|
|
89 |
followingCompanies: {
|
|
|
90 |
entry: "./react-webpack/company/following-companies/index.js",
|
|
|
91 |
output: path.join(__dirname, "public/react-bundles/following-companies"),
|
|
|
92 |
filename: "followingCompaniesBundle.js",
|
|
|
93 |
},
|
|
|
94 |
companiesIWorkWith: {
|
|
|
95 |
entry: "./react-webpack/company/i-work-with/index.js",
|
|
|
96 |
output: path.join(__dirname, "public/react-bundles/company/i-work-with"),
|
|
|
97 |
filename: "iWorkWithBundle.js",
|
|
|
98 |
},
|
|
|
99 |
companiesRequestSent: {
|
|
|
100 |
entry: "./react-webpack/company/request-sent/index.js",
|
|
|
101 |
output: path.join(__dirname, "public/react-bundles/company/request-sent"),
|
|
|
102 |
filename: "requestSentBundle.js",
|
|
|
103 |
},
|
|
|
104 |
companiesInvitationsReceived: {
|
|
|
105 |
entry: "./react-webpack/company/invitations-received/index.js",
|
|
|
106 |
output: path.join(
|
|
|
107 |
__dirname,
|
|
|
108 |
"public/react-bundles/company/invitations-received"
|
|
|
109 |
),
|
|
|
110 |
filename: "invitationsReceivedBundle.js",
|
|
|
111 |
},
|
|
|
112 |
companyView: {
|
|
|
113 |
entry: "./react-webpack/company/view/index.js",
|
|
|
114 |
output: path.join(__dirname, "public/react-bundles/company/view"),
|
|
|
115 |
filename: "companyViewBundle.js",
|
|
|
116 |
},
|
|
|
117 |
appliedJobs: {
|
|
|
118 |
entry: "./react-webpack/job/applied-jobs/index.js",
|
|
|
119 |
output: path.join(__dirname, "public/react-bundles/job/applied-jobs"),
|
|
|
120 |
filename: "appliedJobsBundle.js",
|
|
|
121 |
},
|
|
|
122 |
savedJobs: {
|
|
|
123 |
entry: "./react-webpack/job/saved-jobs/index.js",
|
|
|
124 |
output: path.join(__dirname, "public/react-bundles/job/saved-jobs"),
|
|
|
125 |
filename: "savedJobsBundle.js",
|
|
|
126 |
},
|
|
|
127 |
jobView: {
|
|
|
128 |
entry: "./react-webpack/job/view/index.js",
|
|
|
129 |
output: path.join(__dirname, "public/react-bundles/job/view"),
|
|
|
130 |
filename: "jobViewBundle.js",
|
|
|
131 |
},
|
|
|
132 |
authSignin: {
|
|
|
133 |
entry: "./react-webpack/auth/signin-section/index.js",
|
|
|
134 |
output: path.join(__dirname, "public/react-bundles/auth/signin"),
|
|
|
135 |
filename: "signinBundle.js",
|
|
|
136 |
},
|
|
|
137 |
myGroups: {
|
|
|
138 |
entry: "./react-webpack/group/my-groups/my-groups/index.js",
|
|
|
139 |
output: path.join(__dirname, "public/react-bundles/my-groups"),
|
|
|
140 |
filename: "myGroupsBundle.js",
|
|
|
141 |
},
|
|
|
142 |
groupEdit: {
|
|
|
143 |
entry: "./react-webpack/group/my-groups/edit/index.js",
|
|
|
144 |
output: path.join(__dirname, "public/react-bundles/groupEdit"),
|
|
|
145 |
filename: "groupEdit.js",
|
|
|
146 |
},
|
|
|
147 |
groupView: {
|
|
|
148 |
entry: "./react-webpack/group/view/index.js",
|
|
|
149 |
output: path.join(__dirname, "public/react-bundles/group/groupView"),
|
|
|
150 |
filename: "groupView.js",
|
|
|
151 |
},
|
|
|
152 |
|
|
|
153 |
joinedGroups: {
|
|
|
154 |
entry: "./react-webpack/group/joined-groups/index.js",
|
|
|
155 |
output: path.join(__dirname, "public/react-bundles/group/joined-groups"),
|
|
|
156 |
filename: "joinedGroupsBundle.js",
|
|
|
157 |
},
|
|
|
158 |
groupRequestsSent: {
|
|
|
159 |
entry: "./react-webpack/group/requests-sent/index.js",
|
|
|
160 |
output: path.join(__dirname, "public/react-bundles/group/requests-sent"),
|
|
|
161 |
filename: "requestSentBundle.js",
|
|
|
162 |
},
|
|
|
163 |
groupInvitationsReceived: {
|
|
|
164 |
entry: "./react-webpack/group/invitations-received/index.js",
|
|
|
165 |
output: path.join(
|
|
|
166 |
__dirname,
|
|
|
167 |
"public/react-bundles/group/invitations-received"
|
|
|
168 |
),
|
|
|
169 |
filename: "invitationsReceivedBundle.js",
|
|
|
170 |
},
|
|
|
171 |
accountSettings: {
|
|
|
172 |
entry: "./react-webpack/account-settings/index.js",
|
|
|
173 |
output: path.join(__dirname, "public/react-bundles/account-settings"),
|
|
|
174 |
filename: "accountSettingsBundle.js",
|
|
|
175 |
},
|
|
|
176 |
navBar: {
|
|
|
177 |
entry: "./react-webpack/navbar/index.js",
|
|
|
178 |
output: path.join(__dirname, "public/react-bundles/navbar"),
|
|
|
179 |
filename: "navbarBundle.js",
|
|
|
180 |
},
|
|
|
181 |
chat: {
|
|
|
182 |
entry: "./react-webpack/chat/index.js",
|
|
|
183 |
output: path.join(__dirname, "public/react-bundles/chat"),
|
|
|
184 |
filename: "chatBundle.js",
|
|
|
185 |
},
|
|
|
186 |
mobileChat: {
|
|
|
187 |
entry: "./react-webpack/mobile-chat/index.js",
|
|
|
188 |
output: path.join(__dirname, "public/react-bundles/mobileChat"),
|
|
|
189 |
filename: "mobileChatBundle.js",
|
|
|
190 |
},
|
|
|
191 |
inmail: {
|
|
|
192 |
entry: "./react-webpack/inmail/index.js",
|
|
|
193 |
output: path.join(__dirname, "public/react-bundles/inmail"),
|
|
|
194 |
filename: "inmailBundle.js",
|
|
|
195 |
},
|
|
|
196 |
marketplace: {
|
|
|
197 |
entry: "./react-webpack/marketplace/index.js",
|
|
|
198 |
output: path.join(__dirname, "public/react-bundles/marketplace"),
|
|
|
199 |
filename: "marketplaceBundle.js",
|
|
|
200 |
},
|
|
|
201 |
profileMicrolearning: {
|
|
|
202 |
entry: "./react-webpack/profile-microlearning/index.js",
|
|
|
203 |
output: path.join(__dirname, "public/react-bundles/profile-microlearning"),
|
|
|
204 |
filename: "profileMicrolearningBundle.js",
|
|
|
205 |
},
|
|
|
206 |
resetPassword: {
|
|
|
207 |
entry: "./react-webpack/auth/signin-section/signin-section/reset-password/index.js",
|
|
|
208 |
output: path.join(__dirname, "public/react-bundles/auth/reset-password"),
|
|
|
209 |
filename: "resetPasswordBundle.js",
|
|
|
210 |
},
|
|
|
211 |
search: {
|
|
|
212 |
entry: "./react-webpack/search/index.js",
|
|
|
213 |
output: path.join(__dirname, "public/react-bundles/search"),
|
|
|
214 |
filename: "searchBundle.js",
|
|
|
215 |
},
|
|
|
216 |
postView: {
|
|
|
217 |
entry: "./react-webpack/dashboard/post/index.js",
|
|
|
218 |
output: path.join(__dirname, "public/react-bundles/postView"),
|
|
|
219 |
filename: "postViewBundle.js",
|
|
|
220 |
},
|
275 |
geraldo |
221 |
selfEvaluation: {
|
|
|
222 |
entry: "./react-webpack/self-evaluation/index.js",
|
|
|
223 |
output: path.join(__dirname, "public/react-bundles/self-evaluation"),
|
|
|
224 |
filename: "selfEvaluationBundle.js",
|
|
|
225 |
},
|
561 |
geraldo |
226 |
performanceEvaluation: {
|
|
|
227 |
entry: "./react-webpack/performance-evaluation/index.js",
|
|
|
228 |
output: path.join(__dirname, "public/react-bundles/performance-evaluation"),
|
|
|
229 |
filename: "performanceEvaluationBundle.js",
|
|
|
230 |
},
|
1 |
www |
231 |
};
|
|
|
232 |
|
|
|
233 |
// change active path here
|
2954 |
kerby |
234 |
const currentPath = paths.navBar;
|
1 |
www |
235 |
|
752 |
steven |
236 |
|
|
|
237 |
|
|
|
238 |
|
|
|
239 |
|
1 |
www |
240 |
module.exports = {
|
|
|
241 |
entry: currentPath.entry,
|
|
|
242 |
output: {
|
|
|
243 |
path: currentPath.output,
|
|
|
244 |
filename: currentPath.filename,
|
|
|
245 |
},
|
200 |
steven |
246 |
watch: isDevelopment ? true : false,
|
218 |
steven |
247 |
mode: isDevelopment ? "development" : "production",
|
1 |
www |
248 |
resolve: {
|
|
|
249 |
extensions: [".js", ".jsx", ".scss"],
|
|
|
250 |
},
|
|
|
251 |
module: {
|
|
|
252 |
rules: [
|
|
|
253 |
{
|
|
|
254 |
test: /(js|jsx)$/,
|
|
|
255 |
use: ["babel-loader"],
|
|
|
256 |
exclude: /node_modules/,
|
|
|
257 |
},
|
|
|
258 |
{
|
|
|
259 |
test: /\.css$/i,
|
|
|
260 |
use: [MiniCssExtractPlugin.loader, "css-loader"],
|
|
|
261 |
},
|
|
|
262 |
{
|
|
|
263 |
test: /\.module\.s(a|c)ss$/,
|
|
|
264 |
use: [
|
|
|
265 |
MiniCssExtractPlugin.loader,
|
|
|
266 |
{
|
|
|
267 |
loader: "css-loader",
|
|
|
268 |
options: {
|
|
|
269 |
modules: {
|
|
|
270 |
localIdentName: "[local]--[hash:base64:5]",
|
|
|
271 |
},
|
|
|
272 |
sourceMap: isDevelopment,
|
|
|
273 |
},
|
|
|
274 |
},
|
|
|
275 |
{
|
|
|
276 |
loader: "sass-loader",
|
|
|
277 |
options: {
|
|
|
278 |
sourceMap: isDevelopment,
|
|
|
279 |
},
|
|
|
280 |
},
|
|
|
281 |
],
|
|
|
282 |
},
|
|
|
283 |
{
|
|
|
284 |
test: /\.s(a|c)ss$/,
|
|
|
285 |
exclude: /\.module.(s(a|c)ss)$/,
|
|
|
286 |
use: [
|
|
|
287 |
MiniCssExtractPlugin.loader,
|
|
|
288 |
"css-loader",
|
|
|
289 |
{
|
|
|
290 |
loader: "sass-loader",
|
|
|
291 |
options: {
|
|
|
292 |
sourceMap: isDevelopment,
|
|
|
293 |
},
|
|
|
294 |
},
|
|
|
295 |
],
|
|
|
296 |
},
|
|
|
297 |
],
|
|
|
298 |
},
|
|
|
299 |
plugins: [
|
|
|
300 |
new MiniCssExtractPlugin({
|
|
|
301 |
filename: "[name].css",
|
|
|
302 |
chunkFilename: "[id].css",
|
|
|
303 |
}),
|
|
|
304 |
],
|
|
|
305 |
optimization: {
|
|
|
306 |
minimizer: [
|
|
|
307 |
new TerserPlugin({
|
|
|
308 |
extractComments: false,
|
|
|
309 |
}),
|
|
|
310 |
],
|
|
|
311 |
},
|
|
|
312 |
};
|