Skip to content

Angular - No app.module.ts file found.  #5

Description

@davisriska

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",
      ...
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions