react-playground-vscode icon indicating copy to clipboard operation
react-playground-vscode copied to clipboard

Can't get it to work with CSS a css file

Open matthiasp42 opened this issue 8 years ago • 1 comments

Hi, I think this is a very useful idea for a plugin. Sadly I can't get it to run with importing a .css file.

Here is my Toggle.js

require('./Toggle.css')
import React from 'react';
export default class Toggle extends React.Component {
    state = {}
    render() {
        return (
            <div class="test">
                hallo
            </div >
        );
    }
}

And here is my Toggle.css:

.test{
  color: red;
}

And here is the Error message:

<my_project>/public/components/basics/Toggle.css Module parse failed: <my_project>/public/components/basics/Toggle.css Unexpected token (1:0) You may need an appropriate loader to handle this file type. | .test{ | color: red; | } @ <my_project>/public/components/basics/Toggle.js 21:0-23 @ <my_project>/.react-playground/index.js @ multi (webpack)-dev-server/client?http://localhost:9123 <my_project>/.react-playground/index.js

matthiasp42 avatar May 05 '17 07:05 matthiasp42

Hi @matthiasp42 thanks for the report. css-loader has been added on 0.0.10 and this should work now

wmira avatar May 06 '17 00:05 wmira