指定webpack输出文件位置及文件名。
module.exports = {entry: {...},output: {filename: '[name].js',path: __dirname + '/dist',asyncChunks: true, // 创建按需加载的chunkclean: true, // 生成文件之前清空output目录,也可传入对象}}
对CDN的引入
module.exports = {output: {path: '/cdn/assets/[fullhash]', // fullhash在compilation时被替换publicPath: 'https://cdn.example.com/assets/[fullhash]'}}
:::info publicpath指定按需加载或外部引用的资源,相对路径会相对于html页面解析 :::
动态配置public
在entry配置 __webpack_public_path__变量一边runtime时动态设置
