@Dale-Lin
2022-08-04T13:29:45.000000Z
字数 457
阅读 527
webpack5
output 配置声明如何输出构建结果,支持的配置项包括:
output.path:产物的输出目录;output.filename:产物文件名规则,支持 模板字符串;output.publicPath:服务器路径;output.clean:是否自动清除构建目录下的产物;output.library:NPM library 形态下的一些产物特性,例如:library 名称,模块化规范;output.chunkLoading:异步加载的方案,支持 false/jsonp/require 等;
module.exports = {// ...entry: {main: {import: './src/index.js',library: {name: 'MyLibrary',type: 'umd',umdNamedDefine: true}},another: {import: './src/another.js',library: {name: 'AnotherLibrary',type: 'commonjs2'}}}}
