Sha256: 3ffcec33ba88b5f7d6085a87086578e338c72751381f0e753cba7a34d5dacf11

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

const ExtractTextPlugin = require('extract-text-webpack-plugin')
const { env } = require('../configuration.js')

// Change it to false if you prefer Vue styles to be inlined by javascript in runtime
const extractStyles = false

const cssLoader = [
  { loader: 'css-loader', options: { minimize: env.NODE_ENV === 'production' } },
  { loader: 'postcss-loader', options: { sourceMap: true } },
  'resolve-url-loader'
]
const sassLoader = cssLoader.concat([
  { loader: 'sass-loader', options: { sourceMap: true, indentedSyntax: true } }
])
const scssLoader = cssLoader.concat([
  { loader: 'sass-loader', options: { sourceMap: true } }
])

function vueStyleLoader(loader) {
  if (extractStyles) {
    return ExtractTextPlugin.extract({
      fallback: 'vue-style-loader',
      use: loader
    })
  }
  return ['vue-style-loader'].concat(loader)
}

module.exports = {
  test: /\.vue$/,
  loader: 'vue-loader',
  options: {
    loaders: {
      js: 'babel-loader',
      file: 'file-loader',
      css: vueStyleLoader(cssLoader),
      scss: vueStyleLoader(scssLoader),
      sass: vueStyleLoader(sassLoader)
    }
  }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
webpacker-react-on-rails-3.0.0.rc.1 lib/install/config/loaders/installers/vue.js
webpacker-react-on-rails-2.0 lib/install/config/loaders/installers/vue.js