Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3682 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3682 Rev 3694
Línea 1... Línea 1...
1
const path = require('path');
1
import path from 'path';
2
const isDevelopment = process.env.NODE_ENV === 'development';
2
import isDevelopment from 'process';
3
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
4
const TerserPlugin = require('terser-webpack-plugin');
4
import TerserPlugin from 'terser-webpack-plugin';
5
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
5
// import BundleAnalyzerPlugin from 'webpack-bundle-analyzer';
Línea 6... Línea -...
6
 
-
 
7
// change active path here
6
 
8
const currentPath = {
-
 
9
  entry: './app/index.jsx',
-
 
10
  output: path.join(__dirname, 'public/bundles'),
-
 
11
  filename: 'applicationBundle.js'
-
 
Línea 12... Línea 7...
12
};
7
const currentDirname = path.resolve();
13
 
8
 
14
module.exports = {
9
export default {
15
  entry: currentPath.entry,
10
  entry: './app/index.jsx',
16
  output: {
11
  output: {
17
    path: currentPath.output,
12
    path: path.join(path.resolve(), 'public/bundles'),
18
    filename: currentPath.filename
13
    filename: 'applicationBundle.js'
19
  },
14
  },
20
  watch: false,
15
  watch: false,
21
  mode: 'production',
16
  mode: 'production',
22
  resolve: {
17
  resolve: {
23
    alias: {
18
    alias: {
24
      ckeditor5: path.resolve(__dirname, 'node_modules/ckeditor5/dist/ckeditor5.js'),
19
      ckeditor5: path.resolve(currentDirname, 'node_modules/ckeditor5/dist/ckeditor5.js'),
25
      'ckeditor5.css': path.resolve(__dirname, 'node_modules/ckeditor5/dist/ckeditor5.css'),
20
      'ckeditor5.css': path.resolve(currentDirname, 'node_modules/ckeditor5/dist/ckeditor5.css'),
26
      '@components': path.resolve(__dirname, 'app/components/'),
21
      '@components': path.resolve(currentDirname, 'app/components/'),
27
      '@constants': path.resolve(__dirname, 'app/constants/'),
22
      '@constants': path.resolve(currentDirname, 'app/constants/'),
28
      '@hocs': path.resolve(__dirname, 'app/hocs/index.js'),
23
      '@hocs': path.resolve(currentDirname, 'app/hocs/index.js'),
29
      '@hooks': path.resolve(__dirname, 'app/hooks/index.js'),
24
      '@hooks': path.resolve(currentDirname, 'app/hooks/index.js'),
30
      '@layouts': path.resolve(__dirname, 'app/layouts/'),
25
      '@layouts': path.resolve(currentDirname, 'app/layouts/'),
31
      '@pages': path.resolve(__dirname, 'app/pages/'),
26
      '@pages': path.resolve(currentDirname, 'app/pages/'),
32
      '@providers': path.resolve(__dirname, 'app/providers/'),
27
      '@providers': path.resolve(currentDirname, 'app/providers/'),
33
      '@store': path.resolve(__dirname, 'app/redux/'),
28
      '@store': path.resolve(currentDirname, 'app/redux/'),
34
      '@styles': path.resolve(__dirname, 'app/styles/'),
29
      '@styles': path.resolve(currentDirname, 'app/styles/'),
35
      '@services': path.resolve(__dirname, 'app/services/'),
30
      '@services': path.resolve(currentDirname, 'app/services/'),
36
      '@utils': path.resolve(__dirname, 'app/utils/'),
31
      '@utils': path.resolve(currentDirname, 'app/utils/'),
37
      '@shared': path.resolve(__dirname, 'app/modules/shared/'),
32
      '@shared': path.resolve(currentDirname, 'app/modules/shared/'),
38
      '@api': path.resolve(__dirname, 'app/modules/shared/libs/axios.js'),
33
      '@api': path.resolve(currentDirname, 'app/modules/shared/libs/axios.js'),
39
      '@microlearning': path.resolve(__dirname, 'app/modules/microlearning/'),
34
      '@microlearning': path.resolve(currentDirname, 'app/modules/microlearning/'),
40
      '@knowledges': path.resolve(__dirname, 'app/modules/knowledges/'),
35
      '@knowledges': path.resolve(currentDirname, 'app/modules/knowledges/'),
41
      '@marketplace': path.resolve(__dirname, 'app/modules/marketplace/'),
36
      '@marketplace': path.resolve(currentDirname, 'app/modules/marketplace/'),
42
      '@inmail': path.resolve(__dirname, 'app/modules/inmail/'),
37
      '@inmail': path.resolve(currentDirname, 'app/modules/inmail/'),
43
      '@groups': path.resolve(__dirname, 'app/modules/groups/'),
38
      '@groups': path.resolve(currentDirname, 'app/modules/groups/'),
44
      '@app': path.resolve(__dirname, 'app/'),
39
      '@app': path.resolve(currentDirname, 'app/'),
45
      store: path.resolve(__dirname, 'app/redux/'),
40
      store: path.resolve(currentDirname, 'app/redux/'),
46
      components: path.resolve(__dirname, 'app/components/'),
41
      components: path.resolve(currentDirname, 'app/components/'),
47
      utils: path.resolve(__dirname, 'app/utils/')
42
      utils: path.resolve(currentDirname, 'app/utils/')
48
    },
43
    },
49
    extensions: ['.js', '.jsx', '.scss', '.css']
44
    extensions: ['.js', '.jsx', '.scss', '.css']
50
  },
45
  },
Línea 86... Línea 81...
86
      filename: '[name].css',
81
      filename: '[name].css',
87
      chunkFilename: '[id].css'
82
      chunkFilename: '[id].css'
88
    })
83
    })
89
  ],
84
  ],
90
  optimization: {
85
  optimization: {
91
    minimizer: [
-
 
92
      new TerserPlugin({
86
    minimizer: [new TerserPlugin()]
93
        extractComments: false
-
 
94
      })
-
 
95
    ]
-
 
96
  }
87
  }
97
};
88
};