Skip to content

Commit

Permalink
Reduce the size of the package and do not copy useless files
Browse files Browse the repository at this point in the history
  • Loading branch information
jiawulin001 committed Nov 20, 2021
1 parent 38aa3ab commit 7b8c872
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions webpack/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
*/

var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var WebpackMd5Hash = require('webpack-md5-hash');
// 该插件是对“webpack-md5-hash”的改进:在主文件中获取到各异步模块的hash值,然后将这些hash值与主文件的代码内容一同作为计算hash的参数,这样就能保证主文件的hash值会跟随异步模块的修改而修改。
Expand Down Expand Up @@ -141,7 +139,10 @@ module.exports = {
from: path.resolve(__dirname, '../resources/markdown'),
to: path.resolve(__dirname, '../dist/markdown')
}, {
from: path.resolve(__dirname, '../node_modules/katex/dist'),
context: 'node_modules/katex/dist',
from: {
glob: `${path.resolve(__dirname, '../node_modules/katex/dist')}/**/*.+(min.js|min.css|ttf|woff|woff2)`
},
to: path.resolve(__dirname, '../dist/katex')
}])
]
Expand Down

0 comments on commit 7b8c872

Please sign in to comment.