Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to pass version string to add inside css comment #44

Open
ghost opened this issue Dec 2, 2020 · 2 comments
Open

Unable to pass version string to add inside css comment #44

ghost opened this issue Dec 2, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Dec 2, 2020

I am trying to pass the application version to the SCSS so that i can add it to the comments in the CSS file along with other useful info, but it gets translated from "4.2.0" into "4.2 0" is there a way to disable this auto transformation/parsing?

      {
        test: /\.(sass|scss)$/,
        use: [
          MiniCssExtractPlugin.loader,
          "css-loader",
          "sass-loader",
          {
            loader: "@epegzz/sass-vars-loader",
            options: {
              vars: {
                appVersion: `4.2.0`,
              },
            },
          },
        ],
      },
@ghost
Copy link

ghost commented Dec 2, 2020

Having issues with passing "https://wordpress.org/" too, any was to disabled the parsing and validation:

SassError: Invalid CSS after "...uthorUrl: https": expected 1 selector or at-rule, was "://wordpress.org/;"
        on line 5 of assets/scss/style.scss
>> $themeAuthorUrl: https://wordpress.org/;

   -----------------^

    at processResult (/opt/app/increo/templates/wordpress/web/app/themes/increo-starter-theme/node_modules/webpack/lib/NormalModule.js:583:19)
    at runLoaders (/opt/app/increo/templates/wordpress/web/app/themes/increo-starter-theme/node_modules/webpack/lib/NormalModule.js:676:5)
    at /opt/app/increo/templates/wordpress/web/app/themes/increo-starter-theme/node_modules/loader-runner/lib/LoaderRunner.js:397:11
    at /opt/app/increo/templates/wordpress/web/app/themes/increo-starter-theme/node_modules/loader-runner/lib/LoaderRunner.js:252:18
    at context.callback (/opt/app/increo/templates/wordpress/web/app/themes/increo-starter-theme/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at Object.render [as callback] (/opt/app/increo/templates/wordpress/web/app/themes/increo-starter-theme/node_modules/sass-loader/dist/index.js:62:7)
    at Object.done [as callback] (/opt/app/increo/templates/wordpress/web/app/themes/increo-starter-theme/node_modules/neo-async/async.js:8069:18)
    at options.error (/opt/app/increo/templates/wordpress/web/app/themes/increo-starter-theme/node_modules/node-sass/lib/index.js:293:32)

@epegzz
Copy link
Owner

epegzz commented Apr 4, 2021

🤔 Hm, there's a good chance that throwing in some extra quotes will do the job:

vars: {
  appVersion: `"4.2.0"`,
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant