Title: Webpack Config is stripping out Crypto · Issue #1548 · angular/angular-cli · GitHub
Open Graph Title: Webpack Config is stripping out Crypto · Issue #1548 · angular/angular-cli
X Title: Webpack Config is stripping out Crypto · Issue #1548 · angular/angular-cli
Description: OS? Mac OSX El Capitan Versions. angular-cli: local (v1.0.0-beta.10, branch: webpack) node: 4.4.7 os: darwin x64 Repro steps. I've pulled down the Angular-cli project and am building it locally, so I am using the new webpack version. The...
Open Graph Description: OS? Mac OSX El Capitan Versions. angular-cli: local (v1.0.0-beta.10, branch: webpack) node: 4.4.7 os: darwin x64 Repro steps. I've pulled down the Angular-cli project and am building it locally, so...
X Description: OS? Mac OSX El Capitan Versions. angular-cli: local (v1.0.0-beta.10, branch: webpack) node: 4.4.7 os: darwin x64 Repro steps. I've pulled down the Angular-cli project and am building it locally...
Opengraph URL: https://github.com/angular/angular-cli/issues/1548
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Webpack Config is stripping out Crypto","articleBody":"1. OS? \n Mac OSX El Capitan\n2. Versions. \n angular-cli: local (v1.0.0-beta.10, branch: webpack) \n node: 4.4.7 \n os: darwin x64 \n3. Repro steps.\n I've pulled down the Angular-cli project and am building it locally, so I am using the new webpack version. \n The project that I am building uses Crypto libraries (via a dependency of a dependency ...).\n When I was running `ng build` I was seeing the dependency built like this:\n\n```\n /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';\n\n var crypto = __webpack_require__(147);\n var BufferUtil = __webpack_require__(21);\n var $ = __webpack_require__(15);\n\n var Hash = module.exports;\n\n Hash.sha1 = function(buf) {\n $.checkArgument(BufferUtil.isBuffer(buf));\n return crypto.createHash('sha1').update(buf).digest();\n };\n ...\n```\n\nAnd then when I looked at module 147 (I.E. the crypto module) I was seeing nothing there:\n\n```\n/***/ },\n/* 147 */\n/***/ function(module, exports, __webpack_require__) {\n\n/***/ },\n```\n\nAfter a while of searching I took a look in the Angular-CLI code and saw that part of the webpack config (addon/ng2/models/webpack-build-common.ts) was this:\n\n```\nnode: {\n global: 'window',\n crypto: 'empty',\n module: false,\n clearImmediate: false,\n setImmediate: false\n }\n```\n\nWhen I remove `crypto: 'empty'` everything builds correctly with the crypto module getting pulled in.\n\nSo my question is, why have you specified that crypto should be empty? \nIs there any way to fix this more permanently? \n","author":{"url":"https://github.com/jmc265","@type":"Person","name":"jmc265"},"datePublished":"2016-08-04T10:42:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":73},"url":"https://github.com/1548/angular-cli/issues/1548"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2b2e90c5-dac4-a071-229a-7957e4959cf3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 86C6:A27F4:15A5C88:1E0E322:6980C82B |
| html-safe-nonce | 9f3da3a14e9ff72b09177620558f382c643962a1242cd62f5026559df439b869 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NkM2OkEyN0Y0OjE1QTVDODg6MUUwRTMyMjo2OTgwQzgyQiIsInZpc2l0b3JfaWQiOiI2NDM3NjU0MDQxNTc2NTkxNzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a1504c3e643f90f8a8cfcb2526415fc463bf397691cb807ffbd62d8d3dce0b49 |
| hovercard-subject-tag | issue:169345099 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/1548/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e810128121e4a8832acb5f2966ad4a3f7a82a20a180fab7094d22c11dc4aac2d/angular/angular-cli/issues/1548 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e810128121e4a8832acb5f2966ad4a3f7a82a20a180fab7094d22c11dc4aac2d/angular/angular-cli/issues/1548 |
| og:image:alt | OS? Mac OSX El Capitan Versions. angular-cli: local (v1.0.0-beta.10, branch: webpack) node: 4.4.7 os: darwin x64 Repro steps. I've pulled down the Angular-cli project and am building it locally, so... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jmc265 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c940d5e308643c0003d2824389ea8281bcaae0a9a0d07438e3fb5e0bdc4fef12 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bb3d0fe9b8e408797775c5db420b1ee5ff06e4d0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width