C
C
cester2018-03-07 11:30:01
JavaScript
cester, 2018-03-07 11:30:01

What is the problem with webpack css-modules on windows?

Good afternoon! Tell me who knows what could be the problem with css-modules ?
In this case

module: {
    rules: [{
      test: /\.(s?css|sass)$/,
      exclude: /main\/(components|actions)\/.+\.scss$/,
      use: ['style-loader', 'css-loader', 'sass-loader'],
    }, {
      test: /main\/(components|scenes)\/.+\.scss$/,

...

does not work on windows
This one works on windows but does not work on mac
module: {
    rules: [{
      test: /\.(s?css|sass)$/,
      exclude: /(components|actions).*\.scss$/,
      use: ['style-loader', 'css-loader', 'sass-loader'],
    }, {
      test:  /(components|scenes).*\.scss$/,

...

The styles themselves are written like this
<Dropdown styleName="styles.dropdown" >
...

I will be grateful for your help!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Epifanov, 2018-03-08
@kacheleff

There is a suspicion that the matter may be in the separator in the paths. As you know, separators are different in Unix and Windows systems. For a generic solution to the problem, you can use path.sep from the path module. Try using it to write paths.
Here is an example of a regular expression written using path.sep

A
Alexander Litvinenko, 2018-10-17
@edli007

So you just didn't include them, and the syntax is wrong
https://github.com/TrustyWork/PRP-Webpack4-2018/bl...
<Dropdown styleName={styles.dropdown} >

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question