Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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