Problem moving the file variables.scss to another location

Hi,
I’d like to move all custom files of an Ionic4 app from the src folder to the custom folder.
The two folders are at the same level.
So that I can change only that folder to customize the layout of the app.

I’ve some problem with the variables.scss file.
I’ve modified the file angular.json in this way:

             "styles": [
               {
                "input": "src/theme/variables.scss"
               },

             "styles": [
               {
               "input": "custom/theme/variables.scss"
               },

However when I execute the app in the web mode it seems that the variables defined in the file are not read.
I’ve no erros in the console.

Which could be the problem?
Thank you

cld

Hi,
Try with ionic build and then re-run the app ionic serve

Best Coding,
Getsov

Hi @Getsov thank you for you answer.
I’ve seen that the problem wasn’t the location of the file but the fact that the folder is a symbolic link to another folder.

The location of the file in the new directory is custom/theme/variables.scss.

I’ve done a custom folder that contains all the customizations of the app for a customer.
This folder contains the assets, the resources, some css file, some json file and the variables.scss file.

The real problem is that when Ionic starts, if the custom folder is a real folder that all works well, but if custom is a sybolik link I have no problems with assets and resources, but the variables.scss file is ignored. I don’t know why.

The fact is that it would be better for me to manage the customizations in a folder external to the project, so that I can have them in another repository.

cld

I’ve solved modifying the angular.json file in this way:

      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "preserveSymlinks": true,

That is adding the row:

    "preserveSymlinks": true,
1 Like