UNPKG

606 BJavaScriptView Raw
1const path = require('path');
2const getDistPath = require('./get-dist-path');
3const getDirDevTmp = require('../libs/get-dir-dev-tmp');
4const { buildManifestFilename } = require('../defaults/before-build');
5
6/**
7 * 获取打包文件对应表 (chunkmap) 的文件路径
8 * @param {string} [dist] 打包结果目录,默认为项目指定的路径
9 * @returns {string}
10 */
11module.exports = (dist = getDistPath()) => {
12 if (process.env.WEBPACK_BUILD_ENV === 'dev')
13 return path.resolve(getDirDevTmp(), buildManifestFilename);
14 return path.resolve(dist, buildManifestFilename);
15};