1 Star 0 Fork 0

jasonzhouu/react-viewer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.config.doc.js 738 Bytes
一键复制 编辑 原始数据 按行查看 历史
infeng 提交于 2019-10-22 15:58 . website: modify output filename
const HtmlWebpackPlugin = require('html-webpack-plugin');
const config = require('./webpack.config.common');
const path = require('path');
const fs = require('fs-extra');
const distPath = path.join(__dirname, 'pages-build');
if (fs.existsSync(distPath)) {
fs.removeSync(distPath);
}
config.entry('index').clear().add('./demo/index.tsx');
config.output.path(distPath);
config.output.filename('index.[contenthash].js');
config.mode('production');
config.plugin('html-webpack-plugin')
.use(HtmlWebpackPlugin, [{
filename: 'index.html',
template: './demo/index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: false
},
hash: true,
}]);
module.exports = config.toConfig();
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jasonzhouu/react-viewer.git
git@gitee.com:jasonzhouu/react-viewer.git
jasonzhouu
react-viewer
react-viewer
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385