Skip to content

Commit

Permalink
chore(ng): switch from deprecated browserTarget to buildTarget (#111
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ayushmanchhabra authored Apr 27, 2024
1 parent 3465bfa commit 45292d9
Show file tree
Hide file tree
Showing 6 changed files with 357 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:

jobs:
ci:
runs-on: ubuntu-22.04
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/[email protected]
Expand Down
17 changes: 8 additions & 9 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "nw-angular-example:build:production"
"buildTarget": "nw-angular-example:build:production"
},
"development": {
"browserTarget": "nw-angular-example:build:development"
},
"defaultConfiguration": "development"
}
"buildTarget": "nw-angular-example:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "nw-angular-example:build"
"buildTarget": "nw-angular-example:build"
}
},
"test": {
Expand All @@ -94,8 +94,7 @@
"styles": [
"src/styles.css"
],
"scripts": [],
"karmaConfig": "karma.conf.js"
"scripts": []
}
},
"lint": {
Expand All @@ -116,4 +115,4 @@
"@angular-eslint/schematics"
]
}
}
}
10 changes: 6 additions & 4 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

const { findpath } = require("nw");
const process = require('process');

// const puppeteer = require('puppeteer');
process.env.CHROME_BIN = findpath();
module.exports = async function (config) {

const nw = await import('nw');

process.env.CHROME_BIN = await nw.findpath('nwjs', { flavor: 'sdk' });

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
Expand Down
Loading

0 comments on commit 45292d9

Please sign in to comment.