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