angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

fileReplacements doesn't work with css files

Open Lionardo opened this issue 8 years ago • 45 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Area

- [x] devkit
- [ ] schematics

Versions

node --version: v9.4.0 npm --version: 5.6.0 macOS high sierra 10.13.5

Repro steps

1- In angular.json add a new configuration and try to replace a css file. 2- add a simple background style to header.local.css 3- import the header.css file into styles.scss

E.g.

"configurations": {
            "local": {              
              "optimization": false,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": false,
              "vendorChunk": false,
              "buildOptimizer": false,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/enviroment.local.ts"
                },
                {
                  "replace": "src/css/header.css",
                  "with": "src/css/header.local.css"
                }
              ]
            },

The log given by the failure

none

Desired functionality

get the header.css replaced by header.local.css

Mention any other details that might be useful

Tested with angular cli version 6.0.1 and angular cli version 6.1.0-beta.0

Lionardo avatar Jul 04 '18 13:07 Lionardo

@mcescalante It's been awhile since your post but for index files try using this instead of "fileReplacements":

"index": {
  "input": "src/index.prod.html",
  "output": "index.html"
 },

maxtacco avatar Jun 09 '20 17:06 maxtacco

This also will be useful and easier for robots.txt replacement for production.

BruneXX avatar Aug 07 '20 22:08 BruneXX

@filipesilva @alan-agius4 any update on this?

xiaoxiangmoe avatar Aug 20 '20 10:08 xiaoxiangmoe

Hi asphub, for the Internationalization you can use the i18n built in mechanism provided by Angular !

@kodze I am already using i18n for Internationalization, but the issue is with the SCSS file replacement for the UI to switch Arabic layout.

I am using SCSS variables to manage this

asphub avatar Oct 05 '20 06:10 asphub

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.