text: var path = require('path')
  
  exports.cssLoaders = function (options) {
    options = options || {}
  
    var cssLoader = {
      loader: 'css-loader',
      options: {
        minimize: process.env.NODE_ENV === 'production',
        sourceMap: options.sourceMap
      }
    }
  
    // generate loader string to be used with extract text plugin
    function generateLoaders (loader, loaderOptions) {
      var loaders = [cssLoader]
      if (loader) {
        loaders.push({
          loader: loader + '-loader',
          options: Object.assign({}, loaderOptions, {
            sourceMap: options.sourceMap
          })
        })
      }
  
      function resolveResouce(name) {
        return path.resolve(__dirname, '../src/styles/' + name);
      }
      
      // 使用sass-resources-loader
      // https://hopkinson.github.io/2017/06/30/Vue%E4%B8%ADSASS%E5%A6%82%E4%BD%95%E5%85%A8%E5%B1%80%E4%BD%BF%E7%94%A8%E5%8F%98%E9%87%8F%EF%BC%8Cmixin%EF%BC%8C%E6%88%96%E8%80%85function/
      function generateSassResourceLoader() {
        var loaders = [
          cssLoader, 
          // 'postcss-loader',
          'sass-loader',
          {
              loader: 'sass-resources-loader',
              options: {
                // it need a absolute path
                resources: [resolveResouce('theme-default/global/site.scss'), resolveResouce('mixin.scss')]
              }
          }
        ];
        return ['vue-style-loader'].concat(loaders)
      }
  
      return {
        css: generateLoaders(),
        // postcss: generateLoaders('postcss'),
        // less: generateLoaders('less'),
        // sass: generateSassResourceLoader(),
        scss: generateSassResourceLoader(),
        // stylus: generateLoaders('stylus'),
        // styl: generateLoaders('stylus')
      }
    }
  }