Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 11152 | Rev 11183 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
10836 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 = {
10836 stevensc 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
	competencyTypes: {
19
		entry: './react-webpack/settings/competency-types/index.js',
20
		output: path.join(__dirname, 'public/react-bundles/settings/competency-types'),
21
		filename: 'competencyTypesBundle.js',
22
	},
23
	groupTypes: {
24
		entry: './react-webpack/settings/groups-types/index.js',
25
		output: path.join(__dirname, 'public/react-bundles/settings/group-types'),
26
		filename: 'groupTypesBundle.js',
27
	},
28
	industries: {
29
		entry: './react-webpack/settings/industries/index.js',
30
		output: path.join(__dirname, 'public/react-bundles/settings/industries'),
31
		filename: 'industriesBundle.js',
32
	},
33
	skills: {
34
		entry: './react-webpack/settings/skills/index.js',
35
		output: path.join(__dirname, 'public/react-bundles/settings/skills'),
36
		filename: 'skillsBundle.js',
37
	},
38
	degrees: {
39
		entry: './react-webpack/settings/degrees/index.js',
40
		output: path.join(__dirname, 'public/react-bundles/settings/degrees'),
41
		filename: 'degreesBundle.js',
42
	},
43
	categories: {
44
		entry: './react-webpack/settings/job-categories/index.js',
45
		output: path.join(__dirname, 'public/react-bundles/settings/job-categories'),
46
		filename: 'jobCategoriesBundle.js',
47
	},
48
	profile: {
49
		entry: './react-webpack/profile/index.js',
50
		output: path.join(__dirname, 'public/react-bundles/profile'),
51
		filename: 'profileBundle.js',
52
	},
53
	jobs: {
54
		entry: './react-webpack/jobs/index.js',
55
		output: path.join(__dirname, 'public/react-bundles/jobs'),
56
		filename: 'jobsBundle.js',
57
	},
58
	feeds: {
59
		entry: './react-webpack/feeds/index.js',
60
		output: path.join(__dirname, 'public/react-bundles/feeds'),
61
		filename: 'feedsBundle.js',
62
	},
63
	followers: {
64
		entry: './react-webpack/follower/index.js',
65
		output: path.join(__dirname, 'public/react-bundles/followers'),
66
		filename: 'followersBundle.js',
67
	},
68
	recruitment_and_selection_vacancies: {
69
		entry: './react-webpack/recruitment_and_selection/vacancies/index.js',
70
		output: path.join(__dirname, 'public/react-bundles/recruitment_and_selection/vacancies'),
71
		filename: 'vacanciesBundle.js',
72
	},
73
	recruitment_and_selection_candidates: {
74
		entry: './react-webpack/recruitment_and_selection/candidates/index.js',
75
		output: path.join(__dirname, 'public/react-bundles/recruitment_and_selection/candidates'),
76
		filename: 'candidatesBundle.js',
77
	},
78
	recruitment_and_selection_interviews: {
79
		entry: './react-webpack/recruitment_and_selection/interviews/index.js',
80
		output: path.join(__dirname, 'public/react-bundles/recruitment_and_selection/interviews'),
81
		filename: 'interviewsBundle.js',
82
	}
83
}
4586 stevensc 84
 
85
// change active path here
11156 stevensc 86
const currentPath = paths.recruitment_and_selection_vacancies
4586 stevensc 87
 
88
module.exports = {
10836 stevensc 89
	entry: currentPath.entry,
90
	output: {
91
		path: currentPath.output,
92
		filename: currentPath.filename,
93
	},
94
	watch: isDevelopment ? true : false,
95
	mode: isDevelopment ? 'development' : 'production',
96
	resolve: {
97
		extensions: ['.js', '.jsx', '.scss'],
98
	},
99
	module: {
100
		rules: [
101
			{
102
				test: /(js|jsx)$/,
103
				use: ['babel-loader'],
104
				exclude: /node_modules/,
105
			},
106
			{
107
				test: /\.css$/i,
108
				use: [MiniCssExtractPlugin.loader, 'css-loader'],
109
			},
110
			{
111
				test: /\.module\.s(a|c)ss$/,
112
				use: [
113
					MiniCssExtractPlugin.loader,
114
					{
115
						loader: 'css-loader',
116
						options: {
117
							modules: {
118
								localIdentName: '[local]--[hash:base64:5]',
119
							},
120
							sourceMap: isDevelopment,
121
						},
122
					},
123
					{
124
						loader: 'sass-loader',
125
						options: {
126
							sourceMap: isDevelopment,
127
						},
128
					},
129
				],
130
			},
131
			{
132
				test: /\.s(a|c)ss$/,
133
				exclude: /\.module.(s(a|c)ss)$/,
134
				use: [
135
					MiniCssExtractPlugin.loader,
136
					'css-loader',
137
					{
138
						loader: 'sass-loader',
139
						options: {
140
							sourceMap: isDevelopment,
141
						},
142
					},
143
				],
144
			},
145
		],
146
	},
147
	plugins: [
148
		new MiniCssExtractPlugin({
149
			filename: '[name].css',
150
			chunkFilename: '[id].css',
151
		}),
152
	],
153
	optimization: {
154
		minimizer: [
155
			new TerserPlugin({
156
				extractComments: false,
157
			}),
158
		],
159
	},
160
}