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

do not support .sass files very well #9

Closed
Jinjiang opened this issue Jun 14, 2015 · 8 comments

Comments

@Jinjiang
Copy link
Member

commented Jun 14, 2015

<style lang="scss">
  body {
    margin: 0
  }
</style>

and

<style lang="sass">
  body
    margin: 0
</style>

do not work, but

<style lang="sass">
  body {
    margin: 0
  }
</style>

does.

And directly using sass-loader is well. both .scss and .sass files:

require('!style!css!sass?indentedSyntax!./foo.sass')
require('!style!css!sass!./foo.scss')
@Jinjiang

This comment has been minimized.

Copy link
Member Author

commented Jun 14, 2015

I tried to add some code in loader(part, lang)

  function loader(part, lang) {
    if (lang === 'sass') {lang = 'sass?indentedSyntax'}
    if (lang === 'scss') {lang = 'sass'}
    lang = lang || defaultLang[part];
    var loader = loaders[lang] !== undefined ? loaders[lang] : loaderPrefix[part] + lang;
    return loader ? loader + '!' : '';
  }

but

<style lang="sass">
  body
    margin: 0
</style>

still not work

@Jinjiang Jinjiang changed the title do not support .scss files very well do not support .sass files very well Jun 14, 2015

@sjoerdvisscher

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2015

This works:

<style lang="sass?indentedSyntax">
  body
    margin: 0
</style>
@sjoerdvisscher

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2015

Or alternatively in the webpack config file:

        test: /\.vue$/, loader: vue.withLoaders({
          sass: "style!css!sass?indentedSyntax"
        })
@Jinjiang

This comment has been minimized.

Copy link
Member Author

commented Jun 16, 2015

Thx

@tommymarshall

This comment has been minimized.

Copy link

commented Jan 6, 2016

Can the docs be updated on the main site if it only works with the added indentedSyntax lang?

@NemoAlex

This comment has been minimized.

Copy link

commented Jan 27, 2016

+1
Need to be add to the documentation.

@im-n1

This comment has been minimized.

Copy link

commented Apr 17, 2016

wel... more than one year later and I ran into this again. The docs really needs to updated.

@vladfaust

This comment has been minimized.

Copy link

commented Jun 1, 2016

You should add

vue: {
  loaders: {
    sass: "vue-style-loader!css-loader!sass?indentedSyntax"
  }
}

into your webpack.config.js's module.exports section to make indentation sass syntax work (note that scss will not).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.