Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 2954 | Rev 3639 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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
3197 stevensc 234
const currentPath = paths.notifications;
1 www 235
 
236
module.exports = {
237
  entry: currentPath.entry,
238
  output: {
239
    path: currentPath.output,
240
    filename: currentPath.filename,
241
  },
200 steven 242
  watch: isDevelopment ? true : false,
218 steven 243
  mode: isDevelopment ? "development" : "production",
1 www 244
  resolve: {
245
    extensions: [".js", ".jsx", ".scss"],
246
  },
247
  module: {
248
    rules: [
249
      {
250
        test: /(js|jsx)$/,
251
        use: ["babel-loader"],
252
        exclude: /node_modules/,
253
      },
254
      {
255
        test: /\.css$/i,
256
        use: [MiniCssExtractPlugin.loader, "css-loader"],
257
      },
258
      {
259
        test: /\.module\.s(a|c)ss$/,
260
        use: [
261
          MiniCssExtractPlugin.loader,
262
          {
263
            loader: "css-loader",
264
            options: {
265
              modules: {
266
                localIdentName: "[local]--[hash:base64:5]",
267
              },
268
              sourceMap: isDevelopment,
269
            },
270
          },
271
          {
272
            loader: "sass-loader",
273
            options: {
274
              sourceMap: isDevelopment,
275
            },
276
          },
277
        ],
278
      },
279
      {
280
        test: /\.s(a|c)ss$/,
281
        exclude: /\.module.(s(a|c)ss)$/,
282
        use: [
283
          MiniCssExtractPlugin.loader,
284
          "css-loader",
285
          {
286
            loader: "sass-loader",
287
            options: {
288
              sourceMap: isDevelopment,
289
            },
290
          },
291
        ],
292
      },
293
    ],
294
  },
295
  plugins: [
296
    new MiniCssExtractPlugin({
297
      filename: "[name].css",
298
      chunkFilename: "[id].css",
299
    }),
300
  ],
301
  optimization: {
302
    minimizer: [
303
      new TerserPlugin({
304
        extractComments: false,
305
      }),
306
    ],
307
  },
308
};