Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 4241 | Rev 5205 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

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