apache / incubator-weex-loader

Apache License 2.0
65 stars 32 forks source link

How to use scss And vue-i18n in weex-loader #53

Closed w11p3333 closed 7 years ago

w11p3333 commented 7 years ago

There is no problem using stylus in .vue

<style lang='stylus'>

in webpack.conf.js

{
      test: /\.vue$/,
      loader: loader + '-loader'  // loader will be 'vue' or 'weex'
}

seems it will auto find stylus-loader but scss use sass-loader , how to alias it?

And how to use vue-i18n? the vue way is

{
      test: /\.vue$/,
      loader: 'vue-loader',
     options: {
         loaders: {
             i18n: '@kazupon/vue-i18n-loader'
         }
     }
}

Thanks

w11p3333 commented 7 years ago

ok I found a way to use scss in .vue

<style lang="sass">
  @import './index.scss'
</style>

now you can use .scss

dts commented 7 years ago

In case anybody else finds this, the thing that solved it for me is:

{
  test: /\.vue(\?[^?]+)?$/,
  loaders: 'weex-loader',
  options: {
    loaders: {
      'scss': ['weex-vue-loader/lib/style-loader','sass-loader']
    }
  }
}