Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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