Skip to content

Commit

Permalink
Fix source map paths in Uglify configuration (josdejong#1499)
Browse files Browse the repository at this point in the history
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'
```
  • Loading branch information
joshkel authored Feb 17, 2023
1 parent c2e2c2d commit 56b7494
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
},
Expand Down

0 comments on commit 56b7494

Please sign in to comment.