vuetifyjs / webpack-ssr

Vuetify Webpack SSR Template
https://vuetifyjs.com/overview
62 stars 28 forks source link

Autoprefixer are not applied on .styl files #25

Closed tforssander closed 6 years ago

tforssander commented 6 years ago

Hi, when generating a new project with the following command:

vue init vuetifyjs/webpack-ssr 
# (and activating a-la-carte components with custom theme)

It looks like autoprefixer is only applied on .vue files and not when using the custom theme option.

My first try was to add options: vueConfig for the .styl test in the webpack.base.config.js but couldn't get it working for some reason.

Thanks!

nekosaur commented 6 years ago

Update the .styl rule to look like this

{
  test: /\.styl$/,
  loader: ['vue-style-loader', 'css-loader', {
    loader: 'postcss-loader',
    options: {
      sourceMap: true,
      plugins: [
        require('autoprefixer')({
        browsers: ['last 3 versions']
      })
    ]
  }
}, 'stylus-loader', {
    loader: 'vuetify-loader',
    options: {
      theme: resolve('../assets/stylus/theme.styl')
    }
  }]
}

You will also need to install the postcss-loader

npm install --dev postcss-loader

tforssander commented 6 years ago

Thank you!