weexteam / vue-loader-for-apache-weex

vue-loader-for-apache-weex is a third party plugin, and is not developed nor maintained by Apache Weex.
MIT License
30 stars 27 forks source link

how to use stylus #7

Closed zfha closed 6 years ago

zfha commented 7 years ago

In Vue-loader, I can use stylus, the same config not used in weex-vue-loader. I follow the source code. From weex-loader to weex-vue-loader, but i then don't know how to use. please give me an example to do it! My webpack config is

module: {
      loaders: [
        {
          test: /\.js$/,
          loader: 'babel',
          exclude: /node_modules/
        }, {
          test: /\.vue(\?[^?]+)?$/,
          loaders: ['weex'],
        }
      ]
    },
vue: {
      loaders: {
        stylus: 'css?sourceMap!stylus'
      }
}

THASNK!

dts commented 7 years ago

I got SCSS to work with this:

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

You might try that, but replacing the 'scss' and 'sass' with 'stylus'. This is with Webpack 2 BTW.

chogarcia commented 7 years ago

for me following same instructions a vue-loader works

jefflindholm commented 7 years ago

I have tried a number of things here, when I use the vue-loader for the web page it works fine but weex I get Module not found: Error: Cannot resolve module 'scss-loader'

    loader: 'weex-loader',
    options: {
        loaders: {
            'scss': 'weex-style-loader!css-loader!sass-loader',
            // 'scss': ['weex-vue-loader/lib/style-loader','sass-loader']
        }
    }
    // options: {
    //     loaders: {
    //         scss: [
    //             'weex-css-loader',
    //             'sass-loader',
    //         ]
    //     }
    // }

Anyone got any ideas? Thanks

erha19 commented 6 years ago

Pr:https://github.com/weexteam/weex-vue-loader/pull/14 You can use stylus by:

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