Я пытаюсь минимизировать JS для производства с использованием Node JS. Сценарии NPM следующие:
"scripts": {
"start": "node scripts/server.js",
"build-js": "browserify dist/js/index.js | uglifyjs > dist/js/space/index.min.js",
"watch-js": "watchify src/js/index.js -o dist/js/index.js -dv"
}
Я получаю следующую ошибку при сборке, а именно: npm run build-js
Error: Cannot find module './support/isBuffer' from '/Users/rr/Documents/GitHub/hudddle/dist/js'
at /Users/rr/Documents/GitHub/hudddle/node_modules/browser-resolve/node_modules/resolve/lib/async.js:55:21
at load (/Users/rr/Documents/GitHub/hudddle/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
at onex (/Users/rr/Documents/GitHub/hudddle/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
at /Users/rr/Documents/GitHub/hudddle/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:152:21)
Я могу подтвердить, что нет isBuffer
модуля required
непосредственно по index.js
. Спасибо
Пакет JSON:
{
"name": "hudddle",
"version": "0.4.0",
"private": true,
"scripts": {
"start": "node scripts/server.js",
"build-js": "browserify dist/js/index.js | uglifyjs > dist/js/index.min.js",
"watch-js": "watchify src/js/index.js -o dist/js/index.js -dv"
},
"dependencies": {
"aws-sdk": "^2.311.0",
"body-parser": "^1.18.3",
"busboy": "^0.2.14",
"compression": "^1.7.3",
"debug": "^3.1.0",
"dotenv": "^6.0.0",
"express": "^4.16.3",
"jwt-simple": "^0.5.*",
"moment": "^2.22.2",
"mongoose": "^5.2.14",
"native-toast": "^2.0.0",
"npm": "latest",
"nunjucks": "^3.1.3",
"pdf2pic": "^1.2.6",
"redis": "^2.8.0",
"request": "^2.88.0",
"shortid": "^2.2.13",
"socket.io": "^2.1.1"
},
"devDependencies": {
"browserify": "^16.2.2",
"watchify": "latest",
"uglify-es": "latest"
}