Code Monkey home page Code Monkey logo

Comments (8)

epegzz avatar epegzz commented on July 23, 2024

Hey :)

You got the order wrong. sass-vars-loader needs come after sass:

 module: {  
      {
        test: /\.scss$/,
        loaders: ['style', 'css', 'resolve-url', 'sass?sourceMap', '@epegzz/sass-vars-loader'],

      },
    ],
  },
  sassVars: {
    vars: {
      favouriteColor: 'red',
    }
  },

from sass-vars-loader.

ncphillips avatar ncphillips commented on July 23, 2024

I'm still getting the Undefined Variable error, but there's also this new error:

main.scss:4Uncaught Error: Cannot find module "!!./../../node_modules/css-loader/index.js!./../../node_modules/resolve-url-loader/index.js!./../../node_modules/sass-loader/index.js?sourceMap!./../../node_modules/@epegzz/sass-vars-loader/index.js!./main.scss"

from sass-vars-loader.

epegzz avatar epegzz commented on July 23, 2024

Can you try and see what happens if you remove the resolve-url? sass-vars-loader does not use source maps at this point and thus might break resolve-url which relies on it. I will look into implementing source-map support as soon as possible.

from sass-vars-loader.

ncphillips avatar ncphillips commented on July 23, 2024

Hmmm, I removed resolve-url and switched to just sass, but I'm still getting the same error.

Current COnfig:

 module: {
    loaders: [
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        loader: 'babel-loader'
      },
      {
        test   : /\.css$/,
        loaders: ['style', 'css']
      },
      {
        test: /\.scss$/,
        loaders: ['style', 'css', 'sass', '@epegzz/sass-vars-loader']
      },
      {
        test: /\.json$/,
        loader: 'json-loader'
      },
      { test: /\.(woff2?|ttf|svg|eot|jpe?g)$/, loader: 'ignore-loader' }
    ]
  },
  sassVars: {
    vars: {
      favouriteColor: 'red',
    }
  },

from sass-vars-loader.

epegzz avatar epegzz commented on July 23, 2024

Okay, let's see

  • which version of webpack are you using? (I did not test with version 2 yet)
  • did you install sass-vars-loader locally (not npm install -g)?
  • are you running it in docker?

from sass-vars-loader.

ncphillips avatar ncphillips commented on July 23, 2024

Hey again!

I'm using webpack 1.13.2, it is installed locally, and i am not running in docker

from sass-vars-loader.

epegzz avatar epegzz commented on July 23, 2024

Looks like #5 will fix the issue! Expect a fixed npm version tomorrow :)

from sass-vars-loader.

epegzz avatar epegzz commented on July 23, 2024

resolved in current version on npm

from sass-vars-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.