angular4 error: I get an error when publishing multiple style sheets

0

the angular.cli.json is the one that follows

    {
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "name": "daoiz-y-velarde"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico"
      ],
      "index": "index.html",
      "main": "main.ts",
      "polyfills": "polyfills.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.app.json",
      "testTsconfig": "tsconfig.spec.json",
      "prefix": "app",
      "styles": [
        "styles.css",
        "css/style.css",
        "css/form.css"
      ],
      "scripts": ["../node_modules/jquery/dist/jquery.min.js"],
      "environmentSource": "environments/environment.ts",
      "environments": {
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "lint": [
    {
      "project": "src/tsconfig.app.json",
      "exclude": "**/node_modules/**"
    },
    {
      "project": "src/tsconfig.spec.json",
      "exclude": "**/node_modules/**"
    },
    {
      "project": "e2e/tsconfig.e2e.json",
      "exclude": "**/node_modules/**"
    }
  ],
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "css",
    "component": {}
  }
}

and the project structure is:

src/

>    app/
>        admin/
>              eventos/
>              noticias/
>              puntuaciones/
>              reglamentos/
>              usuarios/
>              admin.component.css
>              admin.component.ts
>              admin.component.html
>       contacto/
>       directives/
>       inicio/
>       interfaces/
>       login/
>       modelo/
>       nosotros/
>       noticias/
>       pipes/
>       politica/
>       registro/
>       reglamentos/
>       request/
>       services/
>       servicios/
>       app.component.css
>       app.component.html 
        app.component.spec.ts
        app.component.ts
        app.module.ts
    assets/
    css/
        camera.css
        font-awesome.css
        form.css
        grid.css
        ie.css
        jquery.fancybox-1.3.4.css
        reset.css
        style.css
        superfish.css
    environments/
    fonts/
    imaGES/
...

The index.html file is

    <!doctype html>
<html lang="es">
<head>
  <meta charset="iso-8859-1">
  <title>Club de tiro Daoiz y Velarde</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
     <meta name = "format-detection" content = "telephone=no" />
     <link rel="icon" href="images/favicon.ico" type="image/x-icon">
     <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
     <link rel="stylesheet" type="text/css" href="/css/camera.css">
     <link rel="stylesheet" type="text/css" href="/css/font-awesome.css">
     <link rel="stylesheet" type="text/css" href="/css/form.css">
     <link rel="stylesheet" type="text/css" href="/css/grid.css">
     <link rel="stylesheet" type="text/css" href="/css/ie.css">
     <link rel="stylesheet" type="text/css" href="/css/jquery.fancybox-1.3.4.css">
     <link rel="stylesheet" type="text/css" href="/css/style.css">
     <link rel="stylesheet" type="text/css" href="/css/reset.css">
     <link rel="stylesheet" type="text/css" href="/css/superfish.css">
</head>
<body id="top">
    <app-root></app-root>
</body>
</html>

style.css is:

@import "reset.css";
@import "grid.css";
@import "superfish.css";

@import url(http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);
@import url(http://fonts.googleapis.com/css?family=Open+Sans:600);


html, body {
    background: url(../images/bg.jpg) 0 0 repeat;
    width: 100%;
    position: relative;
    font: normal 14px/20px 'Ubuntu', sans-serif;
    color: #5e5a59;
    text-align: left;
}
...

and the error in the browser is:

localhost/:1 Refused to apply style from 'http://localhost:4200/css/camera.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/ie.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/font-awesome.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/form.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/grid.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/reset.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/jquery.fancybox-1.3.4.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/superfish.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/camera.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/font-awesome.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/form.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/grid.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/ie.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/jquery.fancybox-1.3.4.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/reset.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/superfish.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
webpack-internal:///../../../core/esm5/core.js:3857 Angular is running in the development mode. Call enableProdMode() to enable the production mode.
127.0.0.1:8080/Daoiz/autenticacion Failed to load resource: net::ERR_CONNECTION_REFUSED

The client part code is in: link

The server war is: link

The bbdd is:

link

    
asked by Carlos Guerra Cubillo 27.02.2018 в 13:51
source

1 answer

0

try the following:

"styles": [
    "styles.css",
    "./css/style.css",
    "./css/form.css"
  ],

and for every change you make to the .angular-cli.json, be sure to restart the server: ng serve

    
answered by 27.02.2018 в 21:36