fix: null check

This commit is contained in:
cha0s 2024-02-14 02:40:26 -06:00
parent 20191e08fa
commit a2fe3b2852

View File

@ -39,7 +39,7 @@ exports.processFleckAssets = async (assets, compilation, jsonCallback) => {
const {RawSource} = compilation.compiler.webpack.sources;
const packageJson = assets['package.json'];
const json = JSON.parse(packageJson.source().toString());
const {files} = json;
const {files = []} = json;
// Add defaults.
files.push('build');
// Add source if it exists.
@ -56,7 +56,7 @@ exports.processFleckAssets = async (assets, compilation, jsonCallback) => {
await jsonCallback(json, compilation);
}
// Add any sourcemaps.
json.files = json.files
json.files = files
.map((filename) => {
const maybeWithMap = [filename];
if (compilation.assets[`${filename}.map`]) {