| Línea 1... |
Línea 1... |
| 1 |
import path from 'path';
|
1 |
import path from 'path';
|
| 2 |
import isDevelopment from 'process';
|
- |
|
| 3 |
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
2 |
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
| 4 |
import TerserPlugin from 'terser-webpack-plugin';
|
3 |
import TerserPlugin from 'terser-webpack-plugin';
|
| 5 |
// import BundleAnalyzerPlugin from 'webpack-bundle-analyzer';
|
4 |
// import BundleAnalyzerPlugin from 'webpack-bundle-analyzer';
|
| 6 |
|
5 |
|
| 7 |
const currentDirname = path.resolve();
|
6 |
const currentDirname = path.resolve();
|
| 8 |
|
7 |
|
| 9 |
export default {
|
8 |
export default {
|
| 10 |
entry: './app/index.jsx',
|
9 |
entry: './app/index.jsx',
|
| 11 |
output: {
|
10 |
output: {
|
| 12 |
path: path.join(path.resolve(), 'public/bundles'),
|
11 |
path: path.join(path.resolve(), 'public/bundles'),
|
| 13 |
filename: 'applicationBundle.js'
|
12 |
filename: 'applicationBundle.js'
|
| 14 |
},
|
13 |
},
|
| 15 |
watch: false,
|
- |
|
| 16 |
mode: 'production',
|
- |
|
| 17 |
resolve: {
|
14 |
resolve: {
|
| 18 |
alias: {
|
15 |
alias: {
|
| 19 |
ckeditor5: path.resolve(currentDirname, 'node_modules/ckeditor5/dist/ckeditor5.js'),
|
16 |
ckeditor5: path.resolve(currentDirname, 'node_modules/ckeditor5/dist/ckeditor5.js'),
|
| 20 |
'ckeditor5.css': path.resolve(currentDirname, 'node_modules/ckeditor5/dist/ckeditor5.css'),
|
17 |
'ckeditor5.css': path.resolve(currentDirname, 'node_modules/ckeditor5/dist/ckeditor5.css'),
|
| 21 |
'@components': path.resolve(currentDirname, 'app/components/'),
|
18 |
'@components': path.resolve(currentDirname, 'app/components/'),
|
| 22 |
'@constants': path.resolve(currentDirname, 'app/constants/'),
|
19 |
'@constants': path.resolve(currentDirname, 'app/constants/'),
|
| 23 |
'@hocs': path.resolve(currentDirname, 'app/hocs/index.js'),
|
20 |
'@hocs': path.resolve(currentDirname, 'app/hocs/index.js'),
|
| 24 |
'@hooks': path.resolve(currentDirname, 'app/hooks/index.js'),
|
21 |
'@hooks': path.resolve(currentDirname, 'app/hooks/index.js'),
|
| 25 |
'@layouts': path.resolve(currentDirname, 'app/layouts/'),
|
22 |
'@layouts': path.resolve(currentDirname, 'app/layouts/'),
|
| 26 |
'@pages': path.resolve(currentDirname, 'app/pages/'),
|
23 |
'@pages': path.resolve(currentDirname, 'app/pages/'),
|
| 27 |
'@providers': path.resolve(currentDirname, 'app/providers/'),
|
24 |
'@providers': path.resolve(currentDirname, 'app/providers/'),
|
| 28 |
'@store': path.resolve(currentDirname, 'app/redux/'),
|
25 |
'@store': path.resolve(currentDirname, 'app/redux/'),
|
| 29 |
'@styles': path.resolve(currentDirname, 'app/styles/'),
|
26 |
'@styles': path.resolve(currentDirname, 'app/styles/'),
|
| 30 |
'@services': path.resolve(currentDirname, 'app/services/'),
|
27 |
'@services': path.resolve(currentDirname, 'app/services/'),
|
| 31 |
'@utils': path.resolve(currentDirname, 'app/utils/'),
|
28 |
'@utils': path.resolve(currentDirname, 'app/utils/'),
|
| 32 |
'@shared': path.resolve(currentDirname, 'app/modules/shared/'),
|
29 |
'@shared': path.resolve(currentDirname, 'app/modules/shared/'),
|
| 33 |
'@api': path.resolve(currentDirname, 'app/modules/shared/libs/axios.js'),
|
30 |
'@api': path.resolve(currentDirname, 'app/modules/shared/libs/axios.js'),
|
| 34 |
'@microlearning': path.resolve(currentDirname, 'app/modules/microlearning/'),
|
31 |
'@microlearning': path.resolve(currentDirname, 'app/modules/microlearning/'),
|
| 35 |
'@knowledges': path.resolve(currentDirname, 'app/modules/knowledges/'),
|
32 |
'@knowledges': path.resolve(currentDirname, 'app/modules/knowledges/'),
|
| 36 |
'@marketplace': path.resolve(currentDirname, 'app/modules/marketplace/'),
|
33 |
'@marketplace': path.resolve(currentDirname, 'app/modules/marketplace/'),
|
| 37 |
'@inmail': path.resolve(currentDirname, 'app/modules/inmail/'),
|
34 |
'@inmail': path.resolve(currentDirname, 'app/modules/inmail/'),
|
| 38 |
'@groups': path.resolve(currentDirname, 'app/modules/groups/'),
|
35 |
'@groups': path.resolve(currentDirname, 'app/modules/groups/'),
|
| 39 |
'@app': path.resolve(currentDirname, 'app/'),
|
36 |
'@app': path.resolve(currentDirname, 'app/'),
|
| 40 |
store: path.resolve(currentDirname, 'app/redux/'),
|
37 |
store: path.resolve(currentDirname, 'app/redux/'),
|
| 41 |
components: path.resolve(currentDirname, 'app/components/'),
|
38 |
components: path.resolve(currentDirname, 'app/components/'),
|
| 42 |
utils: path.resolve(currentDirname, 'app/utils/')
|
39 |
utils: path.resolve(currentDirname, 'app/utils/')
|
| 43 |
},
|
40 |
},
|
| 44 |
extensions: ['.js', '.jsx', '.scss', '.css']
|
41 |
extensions: ['.js', '.jsx', '.scss', '.css']
|
| 45 |
},
|
42 |
},
|
| 46 |
module: {
|
43 |
module: {
|
| 47 |
rules: [
|
44 |
rules: [
|
| 48 |
{
|
45 |
{
|
| 49 |
test: /(js|jsx)$/,
|
46 |
test: /(js|jsx)$/,
|
| 50 |
use: ['babel-loader'],
|
47 |
use: ['babel-loader'],
|
| 51 |
exclude: /node_modules/
|
48 |
exclude: /node_modules/
|
| 52 |
},
|
49 |
},
|
| 53 |
{
|
50 |
{
|
| 54 |
test: /\.css$/i,
|
51 |
test: /\.css$/i,
|
| 55 |
use: [MiniCssExtractPlugin.loader, 'css-loader']
|
52 |
use: [MiniCssExtractPlugin.loader, 'css-loader']
|
| 56 |
},
|
53 |
},
|
| 57 |
{
|
54 |
{
|
| 58 |
test: /\.module\.s(a|c)ss$/,
|
55 |
test: /\.module\.s(a|c)ss$/,
|
| 59 |
use: [
|
56 |
use: [
|
| 60 |
MiniCssExtractPlugin.loader,
|
57 |
MiniCssExtractPlugin.loader,
|
| 61 |
{
|
58 |
{
|
| 62 |
loader: 'css-loader',
|
59 |
loader: 'css-loader',
|
| 63 |
options: {
|
60 |
options: {
|
| 64 |
modules: {
|
61 |
modules: {
|
| 65 |
localIdentName: '[local]--[hash:base64:5]'
|
62 |
localIdentName: '[local]--[hash:base64:5]'
|
| 66 |
},
|
63 |
},
|
| 67 |
sourceMap: isDevelopment
|
64 |
sourceMap: true
|
| 68 |
}
|
65 |
}
|
| 69 |
}
|
66 |
}
|
| 70 |
]
|
67 |
]
|
| 71 |
},
|
68 |
},
|
| 72 |
{
|
69 |
{
|
| 73 |
test: /\.s(a|c)ss$/,
|
70 |
test: /\.s(a|c)ss$/,
|
| 74 |
exclude: /\.module.(s(a|c)ss)$/,
|
71 |
exclude: /\.module.(s(a|c)ss)$/,
|
| 75 |
use: [MiniCssExtractPlugin.loader, 'css-loader']
|
72 |
use: [MiniCssExtractPlugin.loader, 'css-loader']
|
| 76 |
}
|
73 |
}
|
| 77 |
]
|
74 |
]
|
| 78 |
},
|
75 |
},
|
| 79 |
plugins: [
|
76 |
plugins: [
|
| 80 |
new MiniCssExtractPlugin({
|
77 |
new MiniCssExtractPlugin({
|
| 81 |
filename: '[name].css',
|
78 |
filename: '[name].css',
|
| 82 |
chunkFilename: '[id].css'
|
79 |
chunkFilename: '[id].css'
|
| 83 |
})
|
80 |
})
|
| 84 |
],
|
81 |
],
|
| 85 |
optimization: {
|
82 |
optimization: {
|
| 86 |
minimizer: [new TerserPlugin({ extractComments: false })]
|
83 |
minimizer: [new TerserPlugin({ extractComments: false })]
|
| 87 |
}
|
84 |
}
|
| 88 |
};
|
85 |
};
|