acidb/mobiscroll-cli

Angular - No app.module.ts file found.

davisriska opened this issue · 0 comments

When setting up a project with mobiscroll-cli, I received an error -

No app.module.ts file found. You are probably running this command in a non Angular-cli based application. 

I think the issue is that at this line -

if (!utils.importModules(path.resolve(currDir + '/src/app/app.module.ts'), 'app.module.ts', settings.jsFileName)) {
you are not checking angular.json for source root directory.
I got around this issue by just doing the imports myself, but it would be a nice feature if you could support sourceRoot property as the directory where you check for app/app.module.ts.

A snippet of angular.json

{
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "newProjectRoot": "resources",
    "projects": {
        "frontend": {
            "projectType": "application",
            "schematics": {
                "@schematics/angular:component": {
                    "style": "scss"
                },
                "@schematics/angular:application": {
                    "strict": true
                }
            },
            "root": "resources/frontend",
            "sourceRoot": "resources/frontend/src",
      ...
}