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