12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- const webpack = require('webpack');
- const path = require('path');
- const config = require('./config.js');
- module.exports = {
- externals: {
- 'react': 'React',
- 'react-dom': 'ReactDOM',
- 'antd': 'antd',
- 'moment': 'moment'
- },
- resolve: {
- extensions: ['.js', '.jsx'],
- alias: {
- src: path.resolve(__dirname, '../src'),
- views: 'src/views',
- js: 'src/js',
- }
- },
- module: {
- rules: [{
- test: /\.(js|jsx)$/,
- loader: 'babel-loader',
- include: path.resolve(__dirname, '../src'),
- }, {
- test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
- loader: 'url-loader',
- options: {
- limit: 10000,
- name: path.posix.join(config.prod.subDirectory, 'img/[name].[hash:7].[ext]'),
- }
- }, {
- test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
- loader: 'url-loader',
- options: {
- limit: 10000,
- name: path.posix.join(config.prod.subDirectory, 'fonts/[name].[hash:7].[ext]')
- }
- }]
- },
- optimization: {
-
-
-
-
-
-
-
- splitChunks: {
- chunks: "all",
- minSize: 0,
- minChunks: 1,
- maxAsyncRequests: 1,
- maxInitialRequests: 1,
- name: () => {},
- cacheGroups: {
- priority: "0",
- vendor: {
- chunks: "initial",
- test: /react-router|axios|prop-types/,
- name: "vendor",
- minSize: 0,
- minChunks: 1,
- enforce: true,
- reuseExistingChunk: true
- },
- codemirror: {
- chunks: "initial",
- test: /codemirror|react-codemirror2/,
- name: "codemirror",
- minSize: 0,
- minChunks: 1,
- enforce: true,
- reuseExistingChunk: true
- }
- }
- }
- }
- };
|