Ai
1 Star 1 Fork 0

xzMhehe/codingce-resume

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.js 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
xzMhehe 提交于 2022-08-29 17:31 +08:00 . F
/* webpack.config.js
* @ Ma Xinze
*/
// const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
entry: {
app: ['./src/entry.js']
},
output: {
filename: 'static/[name].js?[hash:6]',
path: path.resolve(__dirname)
},
devServer: {
contentBase: path.resolve(__dirname)
},
plugins: [
// new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: './src/index.html',
filename: 'index.html',
inject: 'head',
minify: {
collapseWhitespace: true,
minifyJS: true,
minifyCSS: true
}
})
],
module: {
rules: [
{
test: /\.html$/,
use: 'html-loader'
},
{
test: /\.(less|css)$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader?minimize' },
{ loader: 'postcss-loader' },
{ loader: 'less-loader' }
]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
name: 'static/[name].[ext]?[hash:6]'
}
},
{ // 压缩图片:https://github.com/tcoopman/image-webpack-loader
loader: 'image-webpack-loader',
options: {
bypassOnDebug: true
}
}
]
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
use: {
loader: 'url-loader',
options: {
limit: 8192,
name: 'static/[name].[ext]?[hash:6]'
}
}
}
]
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/codingce/codingce-resume.git
git@gitee.com:codingce/codingce-resume.git
codingce
codingce-resume
codingce-resume
master

搜索帮助