Skip to content

Commit

Permalink
fix: use non-minified bundle because the minified version seems to
Browse files Browse the repository at this point in the history
affect some third-party module resolution strategies. ref:
#14

problem: the uglify-js minified bundle seems to prevent some third-party
module detection/resolution from working properly. Particularly vercel
and its lambda loader. see: #14

solution: use non-minified bundle instead. Size difference is negligible
as this is a backend/server-side bundle and it will help out with debugging also.
  • Loading branch information
talmobi committed Dec 2, 2020
1 parent a7ee3cd commit 6040298
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
"name": "yt-search",
"version": "2.5.0",
"description": "search youtube",
"main": "dist/yt-search.min.js",
"main": "dist/yt-search.js",
"bin": {
"yt-search": "bin/cli.js",
"yt-search-video": "bin/mpv_video.sh",
"yt-search-audio": "bin/mpv_audio.sh"
},
"files": [
"bin/**.*",
"dist/yt-search.min.js"
"dist/yt-search.js"
],
"scripts": {
"debug": "debug=1 node src/index.js --silent",
"build": "npm run build:src && npm run uglify",
"build": "npm run build:src",
"build:src": "browserify --node --no-bundle-external --standalone ytSearch -t [ babelify --presets [ @babel/preset-env ] ] src/index.js -o dist/yt-search.js 2>&1 | wooster",
"uglify": "uglifyjs dist/yt-search.js -cmo dist/yt-search.min.js",
"prepublishOnly": "npm test",
"test:production": "node test/test.js | faucet",
"test:util": "node test/test-get-scripts.js",
Expand Down Expand Up @@ -54,7 +53,6 @@
"looks-same-plus": "0.0.2",
"spacestandard": "~0.3.0",
"tape": "~5.0.1",
"uglify-js": "~3.10.2",
"wooster": "~0.5.0"
}
}
3 changes: 1 addition & 2 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
let yts = require( '../dist/yt-search.min.js' )
// let yts = require( '../dist/yt-search.js' )
let yts = require( '../dist/yt-search.js' )

const lsp = require( 'looks-same-plus' )

Expand Down

0 comments on commit 6040298

Please sign in to comment.