css-modules / postcss-icss-values

Pass arbitrary constants between your module files
MIT License
203 stars 18 forks source link

Variables import is not working from other files #85

Open killerdejavu opened 7 years ago

killerdejavu commented 7 years ago

I have two files

styles1.less

@value lh: 1.5rem

styles2.less

@value lh from './styles1.less'

.heading {
  font-size: lh
}

The above setup doesnt work. Webpack doesnt evaluate anything. It comes as it is to the browser.

But if I use this

@value lh: 1.5rem

.heading {
  font-size: lh
}

The above works.

rpunkfu commented 7 years ago

What's your importLoaders value from webpack config?

slavab89 commented 7 years ago

Experiencing the same actually... Thats my webpack part:

{
      loader: 'css-loader',
      options: {
        localIndentName,
        sourceMap: true,
        modules: true,
        importLoaders: 1
      }
    },
    {
      loader: 'postcss-loader',
      options: {
        plugins: [
          postcssImport({ path: path.resolve(PATHS.app, './css') }),
          postcssCssnext({ browsers: ['> 1%', 'last 2 versions'] }),
          postcssReporter({ clearMessages: true })
        ]
      }
    }

Using https://github.com/reactGo/reactGo as a boilerplate

killerdejavu commented 7 years ago

@rpunkfu Its 1