docz icon indicating copy to clipboard operation
docz copied to clipboard

Loader needed to use css-modules on mdx files

Open camilatropia opened this issue 7 years ago • 1 comments

hey guys! i'm trying to use css-modules with docz, but i'm having a little bit troubles doing the configuration. I installed the docz css plugin and added:

export default {
    title: 'Driver Sharing',
    description: 'This is my awesome documentation',
    plugins: [
       css({
             preprocessor: 'sass',
             cssmodules: true,
             loaderOpts: {
                           rules: [{
                               test: /.css$/,
                               use: ['style-loader', 'css-loader'],
                            }],
            }
      })
   ]
}

on my doczrc.js file

but when i try to import a style on a mdx file, i get the following error:

Failed to compile
./src/components/InputRounded/InputRounded.module.css 1:0
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.

.container {
| color: #acb1c0;
| cursor: default;

Can anyone help me find out what i'm doing wrong?

camilatropia avatar Apr 26 '19 13:04 camilatropia

@camilatropia Look at the workaround in this issue https://github.com/pedronauck/docz/issues/793

ivan-dalmet avatar Apr 30 '19 06:04 ivan-dalmet