diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-15 17:08:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-16 09:42:56 +0200 |
commit | 17c49e60b367868c80f44b9921793dc3a2d9adaa (patch) | |
tree | e17c8d85b7a4301a58a907b6053660c5a6a6f87b | |
parent | 4935a6a1fd38a31c42d1ae8b1e03aa40c475a89c (diff) | |
download | PeerTube-17c49e60b367868c80f44b9921793dc3a2d9adaa.tar.gz PeerTube-17c49e60b367868c80f44b9921793dc3a2d9adaa.tar.zst PeerTube-17c49e60b367868c80f44b9921793dc3a2d9adaa.zip |
Add patch for angular cli 6
-rw-r--r-- | client/angular-cli-patch.js | 15 | ||||
-rw-r--r-- | client/angular.json | 5 | ||||
-rw-r--r-- | client/package.json | 2 |
3 files changed, 19 insertions, 3 deletions
diff --git a/client/angular-cli-patch.js b/client/angular-cli-patch.js new file mode 100644 index 000000000..0829631c2 --- /dev/null +++ b/client/angular-cli-patch.js | |||
@@ -0,0 +1,15 @@ | |||
1 | // Remove patch when https://github.com/angular/angular-cli/issues/10681#issuecomment-389160125 is closed | ||
2 | |||
3 | const fs = require('fs'); | ||
4 | const f = 'node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js'; | ||
5 | |||
6 | fs.readFile(f, 'utf8', function (err,data) { | ||
7 | if (err) { | ||
8 | return console.log(err); | ||
9 | } | ||
10 | var result = data.replace(/node: false/g, 'node: { global: true, crypto: "empty", fs: "empty", process: true, module: false, clearImmediate: false, setImmediate: false }'); | ||
11 | |||
12 | fs.writeFile(f, result, 'utf8', function (err) { | ||
13 | if (err) return console.log(err); | ||
14 | }); | ||
15 | }); | ||
diff --git a/client/angular.json b/client/angular.json index 4a03d7cfe..4f7f7e72b 100644 --- a/client/angular.json +++ b/client/angular.json | |||
@@ -11,6 +11,7 @@ | |||
11 | "build": { | 11 | "build": { |
12 | "builder": "@angular-devkit/build-angular:browser", | 12 | "builder": "@angular-devkit/build-angular:browser", |
13 | "options": { | 13 | "options": { |
14 | "deployUrl": "client/", | ||
14 | "outputPath": "dist", | 15 | "outputPath": "dist", |
15 | "index": "src/index.html", | 16 | "index": "src/index.html", |
16 | "main": "src/main.ts", | 17 | "main": "src/main.ts", |
@@ -41,7 +42,7 @@ | |||
41 | "extractLicenses": true, | 42 | "extractLicenses": true, |
42 | "vendorChunk": false, | 43 | "vendorChunk": false, |
43 | "buildOptimizer": true, | 44 | "buildOptimizer": true, |
44 | "serviceWorker": true, | 45 | "serviceWorker": false, |
45 | "ngswConfigPath": "/src/ngsw-config.json", | 46 | "ngswConfigPath": "/src/ngsw-config.json", |
46 | "fileReplacements": [ | 47 | "fileReplacements": [ |
47 | { | 48 | { |
@@ -136,4 +137,4 @@ | |||
136 | "prefix": "app" | 137 | "prefix": "app" |
137 | } | 138 | } |
138 | } | 139 | } |
139 | } \ No newline at end of file | 140 | } |
diff --git a/client/package.json b/client/package.json index cd975dd0b..58ce7f65d 100644 --- a/client/package.json +++ b/client/package.json | |||
@@ -17,7 +17,7 @@ | |||
17 | "webpack": "webpack", | 17 | "webpack": "webpack", |
18 | "tslint": "tslint", | 18 | "tslint": "tslint", |
19 | "ng": "ng", | 19 | "ng": "ng", |
20 | "postinstall": "npm rebuild node-sass", | 20 | "postinstall": "npm rebuild node-sass && node angular-cli-patch.js", |
21 | "webpack-bundle-analyzer": "webpack-bundle-analyzer" | 21 | "webpack-bundle-analyzer": "webpack-bundle-analyzer" |
22 | }, | 22 | }, |
23 | "license": "GPLv3", | 23 | "license": "GPLv3", |