jgranstrom / sass-extract-loader

Webpack loader for https://github.com/jgranstrom/sass-extract
MIT License
44 stars 13 forks source link

Invalid CSS after "module.exports" #4

Open mascardoso opened 6 years ago

mascardoso commented 6 years ago

Hi. I keep having the issue when trying to do initial configuration on webpack, rather inlining in a JSX file.

I have the following on my webpack config to target on a specific path some scss files:

        test: /\.scss$/,
        loaders: [
          require.resolve('sass-extract-loader')
        ],
        include: paths.specificPath

and on the JSX:

import styles from './styles.scss'

class Colors extends Component {
  render () {
    console.log(styles)

and I get the error:

./styles.scss
Module build failed:
/**
             ^
      Invalid CSS after "module.exports": expected "{", was '= {"global":{"$pale'
      in styles.scss (line 1, column 15)

but if I use and ditch the webpack config:

import styles from 'sass-extract-loader!./styles.scss'

class Colors extends Component {
  render () {
    console.log(styles)

it works! Any ideas? More info?