#561·guess

guess.js not compatible if angular is in nx workspace

Author: ElecTreeFryingCreated Jul 26, 2022Updated Nov 3, 2022

Need help on how to use guess.js with angular in nx workspace.

guess-parser/dist/guess-parser/index.js

javascript
    var path = ['package.json', '../package.json']
        .map(function (p) { return path_1.join(base, p); })
        .filter(fs_1.existsSync)
        .pop();
    if (!path) {
        throw new Error('Unable to discover the project type');
    }
    var content = JSON.parse(fs_1.readFileSync(path).toString());
    var exists = function (file) { return fs_1.existsSync(path_1.join(base, file)); };
    var d = dep(content);
    var dd = devDep(content);
    var tsconfig = 'tsconfig.app.json';
    var srcTsConfig = path_1.join('src', tsconfig);
    if (dd('@angular/cli') && (exists(srcTsConfig) || exists(tsconfig))) {

This line of code will always return false. exists(srcTsConfig) || exists(tsconfig)

NX workspace file structure

- apps
--> my-project
----> tsconfig.app.json
- package.json