Skip to content

Commit

Permalink
fix(build): Make the build work on windows (#2231)
Browse files Browse the repository at this point in the history
As suggested in
#1799 (comment)
  • Loading branch information
NothingEverHappens authored and jamesdaniels committed Oct 30, 2019
1 parent 6eb1551 commit 97d8532
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"karma": "karma start",
"test:universal": "npm run build && cp -R dist/packages-dist test/universal-test/node_modules/angularfire2 && cd test/universal-test && npm run prerender",
"delayed_karma": "sleep 10 && karma start",
"build": "rm -rf dist && node tools/build.js && npm pack ./dist/packages-dist",
"build": "rimraf dist && node tools/build.js && npm pack ./dist/packages-dist",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
"build:wrapper": "npm i --prefix wrapper && npm run --prefix wrapper build && npm pack ./dist/wrapper-dist"
},
Expand Down
9 changes: 6 additions & 3 deletions tools/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const { switchMap, switchMapTo, tap } = require('rxjs/operators');
const { copy, readFileSync, writeFile, writeFileSync, statSync } = require('fs-extra');
const { prettySize } = require('pretty-size');
const gzipSize = require('gzip-size');
const path = require('path');
const resolve = require('rollup-plugin-node-resolve');
const pkg = require(`${process.cwd()}/package.json`);

Expand Down Expand Up @@ -124,8 +125,10 @@ const DEST_PKG_PATHS = {
};

// Constants for running typescript commands
const TSC = 'node_modules/.bin/tsc';
const NGC = 'node_modules/.bin/ngc';
const binSuffix = process.platform === "win32" ? '.cmd' : '';
const TSC = path.normalize('node_modules/.bin/tsc' + binSuffix);
const NGC = path.normalize('node_modules/.bin/ngc' + binSuffix);

const TSC_ARGS = (name, config = 'build') => [`-p`, `${process.cwd()}/src/${name}/tsconfig-${config}.json`];
const TSC_TEST_ARGS = [`-p`, `${process.cwd()}/src/tsconfig-test.json`];

Expand Down Expand Up @@ -408,4 +411,4 @@ database-deprecated.umd.js - ${dbdepStats.size}, ${dbdepStats.gzip}
}));
}

buildLibrary(GLOBALS).subscribe(() => { }, err => { console.error(err) });
buildLibrary(GLOBALS).subscribe(() => { }, err => { console.error(err) });

0 comments on commit 97d8532

Please sign in to comment.