Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【@vue/cli配置在vue-loader后执行另外一个loader】 #58

Open
kind-hearted opened this issue Sep 18, 2018 · 0 comments
Open

【@vue/cli配置在vue-loader后执行另外一个loader】 #58

kind-hearted opened this issue Sep 18, 2018 · 0 comments

Comments

@kind-hearted
Copy link
Owner

const path = require('path')

process.env.NODE_ENV = 'development'

module.exports = {
  chainWebpack(config) {
    // 调整loader的执行顺序
    const vueRule = config.module.rule('vue')
    const vueLoader = vueRule.uses.get('vue-loader')

    vueRule.uses.delete('vue-loader')

    vueRule
      .use('after-vue-loader')
      .loader('./loaders/after-vue-loader.js')
      .options({ })

    vueRule.uses.set('vue-loader', vueLoader)
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant