Skip to content

Commit

Permalink
https://github.com/brianc/node-postgres/issues/838
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-yang-pearson-dev committed Aug 31, 2020
1 parent c28ddf2 commit aaf2d7f
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 19 deletions.
16 changes: 16 additions & 0 deletions fix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const fs = require('fs');
const path = require('path');

const pgClientPath = path.resolve(__dirname, 'node_modules', 'pg', 'lib', 'native', 'client.js');

fs.readFile(pgClientPath, 'utf8', function(err, data) {
if (err) {
return console.log(err);
}

const result = data.replace("var Native = require('pg-native')", 'var Native = null');

fs.writeFile(pgClientPath, result, 'utf8', function(err) {
if (err) return console.log(err);
});
});
5 changes: 4 additions & 1 deletion my-app/dist/angular-nodejs-example/main-es2015.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion my-app/dist/angular-nodejs-example/main-es2015.js.map

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions my-app/dist/angular-nodejs-example/main-es5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion my-app/dist/angular-nodejs-example/main-es5.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion my-app/dist/angular-nodejs-example/polyfills-es2015.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions my-app/dist/angular-nodejs-example/polyfills-es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -19047,15 +19047,15 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
/***/
function _(module, exports, __webpack_require__) {
__webpack_require__(
/*! /Users/bhargavbachina/Projects/angular-nodejs-example/my-app/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/es5-polyfills.js */
/*! /Users/yangju/projects/training/Angular-IOT/my-app/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/es5-polyfills.js */
"./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/es5-polyfills.js");

__webpack_require__(
/*! zone.js/dist/zone-legacy */
"./node_modules/zone.js/dist/zone-legacy.js");

module.exports = __webpack_require__(
/*! /Users/bhargavbachina/Projects/angular-nodejs-example/my-app/src/polyfills.ts */
/*! /Users/yangju/projects/training/Angular-IOT/my-app/src/polyfills.ts */
"./src/polyfills.ts");
/***/
}
Expand Down
6 changes: 3 additions & 3 deletions my-app/dist/angular-nodejs-example/styles-es2015.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions my-app/dist/angular-nodejs-example/styles-es5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"build": "webpack",
"dev": "nodemon ./server.js localhost 80",
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
"start": "node server.js",
"postinstall": "node fix.js"
},
"repository": {
"type": "git",
Expand All @@ -31,7 +32,7 @@
"gulp": "^4.0.2",
"gulp-zip": "^5.0.1",
"nodemon": "^2.0.2",
"webpack": "^4.44.1",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.12",
"webpack-stream": "^5.2.1"
}
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const path = require('path');
var webpack = require('webpack');
//var webpack = require('webpack');

module.exports = {
entry: './server.js',
mode: 'production',
target: 'node',
plugins: [ new webpack.IgnorePlugin(/^pg-native$/) ],
//plugins: [ new webpack.IgnorePlugin(/^pg-native$/)],
output: {
path: path.resolve(__dirname, '.'),
filename: 'server.bundle.js'
Expand Down

0 comments on commit aaf2d7f

Please sign in to comment.