Skip to content

Angular.json scripts are not loading #13402

@liesahead

Description

@liesahead

Bug Report or Feature Request (mark with an x)

- [X ] bug report
- [ ] feature request

Command (mark with an x)

- [ ] new
- [X ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Angular Version:

Angular CLI: 7.1.4
Node: 10.7.0
OS: win32 x64
Angular: 7.1.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.11.4
@angular-devkit/build-angular      0.11.4
@angular-devkit/build-ng-packagr   0.11.4
@angular-devkit/build-optimizer    0.11.4
@angular-devkit/build-webpack      0.11.4
@angular-devkit/core               7.1.4
@angular-devkit/schematics         7.1.4
@angular/cdk                       7.2.0
@angular/flex-layout               7.0.0-beta.22
@angular/material                  7.2.0
@ngtools/json-schema               1.1.0
@ngtools/webpack                   7.1.4
@schematics/angular                7.1.4
@schematics/update                 0.11.4
ng-packagr                         4.4.5
rxjs                               6.3.3
typescript                         3.1.6
webpack                            4.23.1

Description

angular.json "scripts" are not loading for some reason

NOT WORKING

"scripts": [
    "node_modules/codemirror/mode/css/css.js",
    "node_modules/codemirror/mode/javascript/javascript.js",
    "node_modules/codemirror/mode/htmlmixed/htmlmixed.js"
]

but when I import scripts right into component where I use them, it WORKS

import '../../../../../../../../../node_modules/codemirror/mode/css/css.js';
import '../../../../../../../../../node_modules/codemirror/mode/javascript/javascript.js';
import '../../../../../../../../../node_modules/codemirror/mode/htmlmixed/htmlmixed.js';

I don't like this 'workaround' to be fair, I tried to search why scripts are not loaded from angular.json, but haven't found any solutions except very bad 'workarounds'

Desired functionality

Scripts should be loaded from angular.json file

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions