Compacting node_modules for client-side deployment

后端 未结 2 1344
名媛妹妹
名媛妹妹 2020-12-20 19:17

I\'m implementing a client-side application in JavaScript using Node.js. Because I will be deploying the software on many machines, I would like to minimize the size of the

相关标签:
2条回答
  • 2020-12-20 19:57

    grun-package-minifier is not found ( This is not an actual answer. I wanted to commet in above answer but I do not have sufficient reputation yet :( ).

    npm install grunt-package-minifier --save-dev Password: npm WARN package.json zigbee_gateway_js@0.0.0 No repository field. npm WARN package.json zigbee_gateway_js@0.0.0 No README data npm ERR! 404 404 Not Found: grunt-package-minifier npm ERR! 404 npm ERR! 404 'grunt-package-minifier' is not in the npm registry.

    0 讨论(0)
  • 2020-12-20 20:02

    FWIW: grunt-package-minifier. My use case is a bit unusual since we are developing a cross-browser extension framework. Like Browserify and unlike standard NodeJS deployments we want to minimize the size of our distribution, including any CommonJS modules. But unlike Browserify we support CommonJS so we can keep the module structure rather than concatenating everything into one big file.

    Essentially I strip all the package.json, README, test files, etc. from node_modules but keep the essential JavaScript files in a structure that can be used by a CommonJS module loader.

    0 讨论(0)
提交回复
热议问题