17-js代码压缩

2023-06-15,,

const { resolve } = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = {
entry: './src/js/index.js',
output: {
filename: 'js/built.js',
path: resolve(__dirname, 'build')
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html'
})
],
// 生产环境下会自动压缩js代码
mode: 'production'
};

17-js代码压缩的相关教程结束。

《17-js代码压缩.doc》

下载本文的Word格式文档,以方便收藏与打印。