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