From 2e0eb3332f9143dde8e628196d4bb9774abf8858 Mon Sep 17 00:00:00 2001 From: Josh Kelley Date: Thu, 16 Feb 2023 15:54:22 -0500 Subject: [PATCH] Fix source map paths in Uglify configuration Source maps were written with `"0"` as the source filename. This could result in errors similar to the following in Webpack (depending on the Webpack configuration): ``` WARNING in ../../node_modules/jsoneditor/dist/jsoneditor.min.js Module Warning (from ../../node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/josh/app/node_modules/jsoneditor/dist/0' file: Error: ENOENT: no such file or directory, open '/Users/josh/app/node_modules/jsoneditor/dist/0' ``` --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index cf79da098..804fe9475 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -102,7 +102,7 @@ const compilerMinimalist = webpack({ function minify (name) { const code = String(fs.readFileSync(DIST + '/' + name + '.js')) - const result = uglify.minify(code, { + const result = uglify.minify({ [name + '.js']: code }, { sourceMap: { url: name + '.map' },