Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 275 | Rev 290 | 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
  },
170 steven 13
  dashboard2: {
14
    entry: "./react-webpack/dashboard/components/dashboard2.js",
15
    output: path.join(__dirname, "public/react-bundles/dashboard"),
16
    filename: "dashboardBundle2.js",
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
  },
1 www 226
};
227
 
228
// change active path here
281 efrain 229
const currentPath = paths.selfEvaluation;
1 www 230
 
231
module.exports = {
232
  entry: currentPath.entry,
233
  output: {
234
    path: currentPath.output,
235
    filename: currentPath.filename,
236
  },
200 steven 237
  watch: isDevelopment ? true : false,
218 steven 238
  mode: isDevelopment ? "development" : "production",
1 www 239
  resolve: {
240
    extensions: [".js", ".jsx", ".scss"],
241
  },
242
  module: {
243
    rules: [
244
      {
245
        test: /(js|jsx)$/,
246
        use: ["babel-loader"],
247
        exclude: /node_modules/,
248
      },
249
      {
250
        test: /\.css$/i,
251
        use: [MiniCssExtractPlugin.loader, "css-loader"],
252
      },
253
      {
254
        test: /\.module\.s(a|c)ss$/,
255
        use: [
256
          MiniCssExtractPlugin.loader,
257
          {
258
            loader: "css-loader",
259
            options: {
260
              modules: {
261
                localIdentName: "[local]--[hash:base64:5]",
262
              },
263
              sourceMap: isDevelopment,
264
            },
265
          },
266
          {
267
            loader: "sass-loader",
268
            options: {
269
              sourceMap: isDevelopment,
270
            },
271
          },
272
        ],
273
      },
274
      {
275
        test: /\.s(a|c)ss$/,
276
        exclude: /\.module.(s(a|c)ss)$/,
277
        use: [
278
          MiniCssExtractPlugin.loader,
279
          "css-loader",
280
          {
281
            loader: "sass-loader",
282
            options: {
283
              sourceMap: isDevelopment,
284
            },
285
          },
286
        ],
287
      },
288
    ],
289
  },
290
  plugins: [
291
    new MiniCssExtractPlugin({
292
      filename: "[name].css",
293
      chunkFilename: "[id].css",
294
    }),
295
  ],
296
  optimization: {
297
    minimizer: [
298
      new TerserPlugin({
299
        extractComments: false,
300
      }),
301
    ],
302
  },
303
};