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

Allow for production build #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ridem
Copy link

@ridem ridem commented Apr 26, 2018

The rules in production are slightly different for css modules:

     { test: /\.css$/, exclude: /\.module\.css$/, loader: [Array] },
     { test: /\.css$/, loader: [Array] },

In the dev environment, this is what is passed:

     { test: /\.css$/, exclude: /\.module\.css$/, use: [Array] },
     { test: /\.module\.css$/, use: [Array] },

The rules in production are slightly different for css modules:
```
     { test: /\.css$/, exclude: /\.module\.css$/, loader: [Array] },
     { test: /\.css$/, loader: [Array] },
```

In the dev environment, this is what is passed:
```
     { test: /\.css$/, exclude: /\.module\.css$/, use: [Array] },
     { test: /\.module\.css$/, use: [Array] },
```
@dyun8080
Copy link

@ridem thanks you 🤗🤗
rewireLess.withLoaderOptions append javascriptEnabled: true

@LBC100
Copy link

LBC100 commented Jul 13, 2018

Can't you use it?

@LBC100
Copy link

LBC100 commented Jul 13, 2018

...cssRules.use,
                    ^

TypeError: Cannot read property 'use' of undefined
at createRule (F:\github\hrsdProject\react-hrsd\node_modules\react-app-rewire-less-modules\index.js:28:25)
at F:\github\hrsdProject\react-hrsd\node_modules\react-app-rewire-less-modules\index.js:47:29
at Object.override [as webpack] (F:\github\hrsdProject\react-hrsd\config-overrides.js:6:14)
at Object. (F:\github\hrsdProject\react-hrsd\node_modules\react-app-rewired\scripts\start.js:13:13)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3

@Fea-Sin
Copy link

Fea-Sin commented Jul 30, 2018

Is anyone can use?


cssRules.use

TypeError: Cannot read property 'use' of undefined

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

Successfully merging this pull request may close these issues.

4 participants