chain-webpack.js 699 字节
Newer Older
1 2
const vueLoader = require('@dcloudio/uni-cli-shared/lib/vue-loader')

fxy060608's avatar
fxy060608 已提交
3
module.exports = config => {
fxy060608's avatar
fxy060608 已提交
4 5
  config.module
    .rule('vue')
6
    .test(vueLoader.test)
fxy060608's avatar
fxy060608 已提交
7
    .use('vue-loader')
8 9
    .loader(vueLoader.loader)
    .tap(options => Object.assign(options, vueLoader.options({}, {
fxy060608's avatar
fxy060608 已提交
10
      'quickapp-native': true
11
    })))
fxy060608's avatar
fxy060608 已提交
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

  config.module
    .rule('vue')
    .uses
    .delete('cache-loader')

  config.plugin('extract-css')
    .init((Plugin, args) => new Plugin({
      filename: '[name].css.json'
    }))

  config.plugins.delete('hmr')
  config.plugins.delete('html')
  config.plugins.delete('copy')
  config.plugins.delete('preload')
  config.plugins.delete('prefetch')
}