Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 16650 Rev 16781
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')
Línea 5... Línea 5...
5
 
5
 
6
// Add paths while bundling
6
// Add paths while bundling
7
const paths = {
7
const paths = {
8
  menu: {
8
  menu: {
9
    entry: "./react-webpack/menu/index.js",
9
    entry: './react-webpack/menu/index.js',
10
    output: path.join(__dirname, "public/react-bundles/menu"),
10
    output: path.join(__dirname, 'public/react-bundles/menu'),
11
    filename: "menuBundle.js",
11
    filename: 'menuBundle.js'
12
  },
12
  },
13
  companySizes: {
13
  companySizes: {
14
    entry: "./react-webpack/settings/company-sizes/index.js",
14
    entry: './react-webpack/settings/company-sizes/index.js',
15
    output: path.join(__dirname, "public/react-bundles/settings/company-sizes"),
15
    output: path.join(__dirname, 'public/react-bundles/settings/company-sizes'),
16
    filename: "companySizesBundle.js",
16
    filename: 'companySizesBundle.js'
17
  },
17
  },
18
  hobbies: {
18
  hobbies: {
19
    entry: "./react-webpack/settings/hobbies-and-interests/index.js",
19
    entry: './react-webpack/settings/hobbies-and-interests/index.js',
20
    output: path.join(
20
    output: path.join(
21
      __dirname,
21
      __dirname,
22
      "public/react-bundles/settings/hobbies-and-interests"
22
      'public/react-bundles/settings/hobbies-and-interests'
23
    ),
23
    ),
24
    filename: "hobbiesAndInterestsBundle.js",
24
    filename: 'hobbiesAndInterestsBundle.js'
25
  },
25
  },
26
  aptitudes: {
26
  aptitudes: {
27
    entry: "./react-webpack/settings/aptitudes/index.js",
27
    entry: './react-webpack/settings/aptitudes/index.js',
28
    output: path.join(__dirname, "public/react-bundles/settings/aptitudes"),
28
    output: path.join(__dirname, 'public/react-bundles/settings/aptitudes'),
29
    filename: "aptitudesBundle.js",
29
    filename: 'aptitudesBundle.js'
30
  },
30
  },
31
  competencyTypes: {
31
  competencyTypes: {
32
    entry: "./react-webpack/settings/competency-types/index.js",
32
    entry: './react-webpack/settings/competency-types/index.js',
33
    output: path.join(
33
    output: path.join(
34
      __dirname,
34
      __dirname,
35
      "public/react-bundles/settings/competency-types"
35
      'public/react-bundles/settings/competency-types'
36
    ),
36
    ),
37
    filename: "competencyTypesBundle.js",
37
    filename: 'competencyTypesBundle.js'
38
  },
38
  },
39
  groupTypes: {
39
  groupTypes: {
40
    entry: "./react-webpack/settings/groups-types/index.js",
40
    entry: './react-webpack/settings/groups-types/index.js',
41
    output: path.join(__dirname, "public/react-bundles/settings/group-types"),
41
    output: path.join(__dirname, 'public/react-bundles/settings/group-types'),
42
    filename: "groupTypesBundle.js",
42
    filename: 'groupTypesBundle.js'
43
  },
43
  },
44
  industries: {
44
  industries: {
45
    entry: "./react-webpack/settings/industries/index.js",
45
    entry: './react-webpack/settings/industries/index.js',
46
    output: path.join(__dirname, "public/react-bundles/settings/industries"),
46
    output: path.join(__dirname, 'public/react-bundles/settings/industries'),
47
    filename: "industriesBundle.js",
47
    filename: 'industriesBundle.js'
48
  },
48
  },
49
  skills: {
49
  skills: {
50
    entry: "./react-webpack/settings/skills/index.js",
50
    entry: './react-webpack/settings/skills/index.js',
51
    output: path.join(__dirname, "public/react-bundles/settings/skills"),
51
    output: path.join(__dirname, 'public/react-bundles/settings/skills'),
52
    filename: "skillsBundle.js",
52
    filename: 'skillsBundle.js'
53
  },
53
  },
54
  degrees: {
54
  degrees: {
55
    entry: "./react-webpack/settings/degrees/index.js",
55
    entry: './react-webpack/settings/degrees/index.js',
56
    output: path.join(__dirname, "public/react-bundles/settings/degrees"),
56
    output: path.join(__dirname, 'public/react-bundles/settings/degrees'),
57
    filename: "degreesBundle.js",
57
    filename: 'degreesBundle.js'
58
  },
58
  },
59
  categories: {
59
  categories: {
60
    entry: "./react-webpack/settings/job-categories/index.js",
60
    entry: './react-webpack/settings/job-categories/index.js',
61
    output: path.join(
61
    output: path.join(
62
      __dirname,
62
      __dirname,
63
      "public/react-bundles/settings/job-categories"
63
      'public/react-bundles/settings/job-categories'
64
    ),
64
    ),
65
    filename: "jobCategoriesBundle.js",
65
    filename: 'jobCategoriesBundle.js'
66
  },
66
  },
67
  aptitudes: {
67
  aptitudes: {
68
    entry: "./react-webpack/settings/aptitudes/index.js",
68
    entry: './react-webpack/settings/aptitudes/index.js',
69
    output: path.join(__dirname, "public/react-bundles/settings/aptitudes"),
69
    output: path.join(__dirname, 'public/react-bundles/settings/aptitudes'),
70
    filename: "aptitudesBundle.js",
70
    filename: 'aptitudesBundle.js'
71
  },
71
  },
72
  hobbiesAndInterests: {
72
  hobbiesAndInterests: {
73
    entry: "./react-webpack/settings/hobbies-and-interests/index.js",
73
    entry: './react-webpack/settings/hobbies-and-interests/index.js',
74
    output: path.join(
74
    output: path.join(
75
      __dirname,
75
      __dirname,
76
      "public/react-bundles/settings/hobbies-and-interests"
76
      'public/react-bundles/settings/hobbies-and-interests'
77
    ),
77
    ),
78
    filename: "hobbiesAndInterestsBundle.js",
78
    filename: 'hobbiesAndInterestsBundle.js'
79
  },
79
  },
80
  profile: {
80
  profile: {
81
    entry: "./react-webpack/profile/index.js",
81
    entry: './react-webpack/profile/index.js',
82
    output: path.join(__dirname, "public/react-bundles/profile"),
82
    output: path.join(__dirname, 'public/react-bundles/profile'),
83
    filename: "profileBundle.js",
83
    filename: 'profileBundle.js'
84
  },
84
  },
85
  jobs: {
85
  jobs: {
86
    entry: "./react-webpack/jobs/index.js",
86
    entry: './react-webpack/jobs/index.js',
87
    output: path.join(__dirname, "public/react-bundles/jobs"),
87
    output: path.join(__dirname, 'public/react-bundles/jobs'),
88
    filename: "jobsBundle.js",
88
    filename: 'jobsBundle.js'
89
  },
89
  },
90
  feeds: {
90
  feeds: {
91
    entry: "./react-webpack/feeds/index.js",
91
    entry: './react-webpack/feeds/index.js',
92
    output: path.join(__dirname, "public/react-bundles/feeds"),
92
    output: path.join(__dirname, 'public/react-bundles/feeds'),
93
    filename: "feedsBundle.js",
93
    filename: 'feedsBundle.js'
94
  },
94
  },
95
  followers: {
95
  followers: {
96
    entry: "./react-webpack/follower/index.js",
96
    entry: './react-webpack/follower/index.js',
97
    output: path.join(__dirname, "public/react-bundles/followers"),
97
    output: path.join(__dirname, 'public/react-bundles/followers'),
98
    filename: "followersBundle.js",
98
    filename: 'followersBundle.js'
99
  },
99
  },
100
  recruitment_and_selection_vacancies: {
100
  recruitment_and_selection_vacancies: {
101
    entry: "./react-webpack/recruitment_and_selection/vacancies/index.js",
101
    entry: './react-webpack/recruitment_and_selection/vacancies/index.js',
102
    output: path.join(
102
    output: path.join(
103
      __dirname,
103
      __dirname,
104
      "public/react-bundles/recruitment_and_selection/vacancies"
104
      'public/react-bundles/recruitment_and_selection/vacancies'
105
    ),
105
    ),
106
    filename: "vacanciesBundle.js",
106
    filename: 'vacanciesBundle.js'
107
  },
107
  },
108
  recruitment_and_selection_candidates: {
108
  recruitment_and_selection_candidates: {
109
    entry: "./react-webpack/recruitment_and_selection/candidates/index.js",
109
    entry: './react-webpack/recruitment_and_selection/candidates/index.js',
110
    output: path.join(
110
    output: path.join(
111
      __dirname,
111
      __dirname,
112
      "public/react-bundles/recruitment_and_selection/candidates"
112
      'public/react-bundles/recruitment_and_selection/candidates'
113
    ),
113
    ),
114
    filename: "candidatesBundle.js",
114
    filename: 'candidatesBundle.js'
115
  },
115
  },
116
  recruitment_and_selection_interviews: {
116
  recruitment_and_selection_interviews: {
117
    entry: "./react-webpack/recruitment_and_selection/interviews/index.js",
117
    entry: './react-webpack/recruitment_and_selection/interviews/index.js',
118
    output: path.join(
118
    output: path.join(
119
      __dirname,
119
      __dirname,
120
      "public/react-bundles/recruitment_and_selection/interviews"
120
      'public/react-bundles/recruitment_and_selection/interviews'
121
    ),
121
    ),
122
    filename: "interviewsBundle.js",
122
    filename: 'interviewsBundle.js'
123
  },
123
  },
124
  chat: {
124
  chat: {
125
    entry: "./react-webpack/chat/index.js",
125
    entry: './react-webpack/chat/index.js',
126
    output: path.join(__dirname, "public/react-bundles/chat"),
126
    output: path.join(__dirname, 'public/react-bundles/chat'),
127
    filename: "chatBundle.js",
127
    filename: 'chatBundle.js'
128
  },
128
  },
129
  mobileChat: {
129
  mobileChat: {
130
    entry: "./react-webpack/mobile-chat/index.js",
130
    entry: './react-webpack/mobile-chat/index.js',
131
    output: path.join(__dirname, "public/react-bundles/mobileChat"),
131
    output: path.join(__dirname, 'public/react-bundles/mobileChat'),
132
    filename: "mobileChatBundle.js",
132
    filename: 'mobileChatBundle.js'
133
  },
133
  },
134
  objetives_and_goals_planing: {
134
  objetives_and_goals_planing: {
135
    objetives: {
135
    objetives: {
136
      entry: "./react-webpack/objetives_and_goals-planing/objetives/index.js",
136
      entry: './react-webpack/objetives_and_goals-planing/objetives/index.js',
137
      output: path.join(
137
      output: path.join(
138
        __dirname,
138
        __dirname,
139
        "public/react-bundles/objetives_and_goals-planing/objetives"
139
        'public/react-bundles/objetives_and_goals-planing/objetives'
140
      ),
140
      ),
141
      filename: "objetivesBundle.js",
141
      filename: 'objetivesBundle.js'
142
    },
142
    },
143
    goals: {
143
    goals: {
144
      entry: "./react-webpack/objetives_and_goals-planing/goals/index.js",
144
      entry: './react-webpack/objetives_and_goals-planing/goals/index.js',
145
      output: path.join(
145
      output: path.join(
146
        __dirname,
146
        __dirname,
147
        "public/react-bundles/objetives_and_goals-planing/goals"
147
        'public/react-bundles/objetives_and_goals-planing/goals'
148
      ),
148
      ),
149
      filename: "goalsBundle.js",
149
      filename: 'goalsBundle.js'
150
    },
150
    },
151
    tasks: {
151
    tasks: {
152
      entry: "./react-webpack/objetives_and_goals-planing/tasks/index.js",
152
      entry: './react-webpack/objetives_and_goals-planing/tasks/index.js',
153
      output: path.join(
153
      output: path.join(
154
        __dirname,
154
        __dirname,
155
        "public/react-bundles/objetives_and_goals-planing/tasks"
155
        'public/react-bundles/objetives_and_goals-planing/tasks'
156
      ),
156
      ),
157
      filename: "tasksBundle.js",
157
      filename: 'tasksBundle.js'
158
    },
158
    }
159
  },
159
  },
160
  performance_evaluations: {
160
  performance_evaluations: {
161
    forms: {
161
    forms: {
162
      entry: "./react-webpack/performance_evaluations/forms/index.js",
162
      entry: './react-webpack/performance_evaluations/forms/index.js',
163
      output: path.join(
163
      output: path.join(
164
        __dirname,
164
        __dirname,
165
        "public/react-bundles/performance_evaluations/forms"
165
        'public/react-bundles/performance_evaluations/forms'
166
      ),
166
      ),
167
      filename: "formsBundle.js",
167
      filename: 'formsBundle.js'
168
    },
168
    },
169
    evaluations: {
169
    evaluations: {
170
      entry: "./react-webpack/performance_evaluations/evaluations/index.js",
170
      entry: './react-webpack/performance_evaluations/evaluations/index.js',
171
      output: path.join(
171
      output: path.join(
172
        __dirname,
172
        __dirname,
173
        "public/react-bundles/performance_evaluations/evaluations"
173
        'public/react-bundles/performance_evaluations/evaluations'
174
      ),
174
      ),
175
      filename: "evaluationsBundle.js",
175
      filename: 'evaluationsBundle.js'
176
    },
176
    }
177
  },
177
  },
178
  organizational_climate: {
178
  organizational_climate: {
179
    forms: {
179
    forms: {
180
      entry: "./react-webpack/organizational-climate/form/index.js",
180
      entry: './react-webpack/organizational-climate/form/index.js',
181
      output: path.join(
181
      output: path.join(
182
        __dirname,
182
        __dirname,
183
        "public/react-bundles/organizational-climate/form"
183
        'public/react-bundles/organizational-climate/form'
184
      ),
184
      ),
185
      filename: "organizationalFormBundle.js",
185
      filename: 'organizationalFormBundle.js'
186
    },
186
    }
187
  },
187
  },
188
  jobDescription: {
188
  jobDescription: {
189
    entry: "./react-webpack/job_description/index.js",
189
    entry: './react-webpack/job_description/index.js',
190
    output: path.join(__dirname, "public/react-bundles/job_description"),
190
    output: path.join(__dirname, 'public/react-bundles/job_description'),
191
    filename: "jobDescription.js",
191
    filename: 'jobDescription.js'
192
  },
192
  }
Línea 193... Línea 193...
193
};
193
}
194
 
194
 
Línea 195... Línea 195...
195
// change active path here
195
// change active path here
196
const currentPath = paths.feeds;
196
const currentPath = paths.chat
197
 
197
 
198
module.exports = {
198
module.exports = {
199
  entry: currentPath.entry,
199
  entry: currentPath.entry,
200
  output: {
200
  output: {
201
    path: currentPath.output,
201
    path: currentPath.output,
202
    filename: currentPath.filename,
202
    filename: currentPath.filename
203
  },
203
  },
204
  watch: isDevelopment ? true : false,
204
  watch: isDevelopment ? true : false,
205
  mode: isDevelopment ? "development" : "production",
205
  mode: isDevelopment ? 'development' : 'production',
206
  resolve: {
206
  resolve: {
207
    extensions: [".js", ".jsx", ".scss"],
207
    extensions: ['.js', '.jsx', '.scss']
208
  },
208
  },
209
  module: {
209
  module: {
210
    rules: [
210
    rules: [
211
      {
211
      {
212
        test: /(js|jsx)$/,
212
        test: /(js|jsx)$/,
213
        use: ["babel-loader"],
213
        use: ['babel-loader'],
214
        exclude: /node_modules/,
214
        exclude: /node_modules/
215
      },
215
      },
216
      {
216
      {
217
        test: /\.css$/i,
217
        test: /\.css$/i,
218
        use: [MiniCssExtractPlugin.loader, "css-loader"],
218
        use: [MiniCssExtractPlugin.loader, 'css-loader']
219
      },
219
      },
220
      {
220
      {
221
        test: /\.module\.s(a|c)ss$/,
221
        test: /\.module\.s(a|c)ss$/,
222
        use: [
222
        use: [
223
          MiniCssExtractPlugin.loader,
223
          MiniCssExtractPlugin.loader,
224
          {
224
          {
225
            loader: "css-loader",
225
            loader: 'css-loader',
226
            options: {
226
            options: {
227
              modules: {
227
              modules: {
228
                localIdentName: "[local]--[hash:base64:5]",
228
                localIdentName: '[local]--[hash:base64:5]'
229
              },
229
              },
230
              sourceMap: isDevelopment,
230
              sourceMap: isDevelopment
231
            },
231
            }
232
          },
232
          },
233
          {
233
          {
234
            loader: "sass-loader",
234
            loader: 'sass-loader',
235
            options: {
235
            options: {
236
              sourceMap: isDevelopment,
236
              sourceMap: isDevelopment
237
            },
237
            }
238
          },
238
          }
239
        ],
239
        ]
240
      },
240
      },
241
      {
241
      {
242
        test: /\.s(a|c)ss$/,
242
        test: /\.s(a|c)ss$/,
243
        exclude: /\.module.(s(a|c)ss)$/,
243
        exclude: /\.module.(s(a|c)ss)$/,
244
        use: [
244
        use: [
245
          MiniCssExtractPlugin.loader,
245
          MiniCssExtractPlugin.loader,
246
          "css-loader",
246
          'css-loader',
247
          {
247
          {
248
            loader: "sass-loader",
248
            loader: 'sass-loader',
249
            options: {
249
            options: {
250
              sourceMap: isDevelopment,
250
              sourceMap: isDevelopment
251
            },
251
            }
252
          },
252
          }
253
        ],
253
        ]
254
      },
254
      }
255
    ],
255
    ]
256
  },
256
  },
257
  plugins: [
257
  plugins: [
258
    new MiniCssExtractPlugin({
258
    new MiniCssExtractPlugin({
259
      filename: "[name].css",
259
      filename: '[name].css',
260
      chunkFilename: "[id].css",
260
      chunkFilename: '[id].css'
261
    }),
261
    })
262
  ],
262
  ],
263
  optimization: {
263
  optimization: {
264
    minimizer: [
264
    minimizer: [
265
      new TerserPlugin({
265
      new TerserPlugin({
266
        extractComments: false,
266
        extractComments: false
267
      }),
267
      })