Vue

vue-cli3 webpack配置

2018-11-05  本文已影响0人  刘予安

1.列出所有命名规则和插件:

vue inspect --rules

vue inspect --plugins

2.查看某个规则和插件:

vue inspect --rule vue

vue inspect --plugin html

tips:

vue.config.js    修改配置,参考:https://cli.vuejs.org/guide/webpack.html#simple-configuration

详细配置:https://github.com/neutrinojs/webpack-chain

3.添加新的加载器

// vue.config.js

module.exports = {  

    chainWebpack: config => {    // GraphQL Loader   

    config.module.rule('graphql')     

      .test(/\.graphql$/)  

      .use('graphql-tag/loader')        

      .loader('graphql-tag/loader')        

      .end()  }}

上一篇 下一篇

猜你喜欢

热点阅读