Browse Source

修改配置

lincl 3 years ago
parent
commit
cb907c74d0
2 changed files with 39 additions and 37 deletions
  1. 2 1
      mini-pro-web/.gitignore
  2. 37 36
      mini-pro-web/vue.config.js

+ 2 - 1
mini-pro-web/.gitignore

@ -1,7 +1,8 @@
.DS_Store
node_modules
/dist
/intelligent-medicine-abinet
/intelligent-medicine-abinet.zip
# local env files
.env.local

+ 37 - 36
mini-pro-web/vue.config.js

@ -8,47 +8,48 @@ function resolve(dir) {
module.exports = {
  publicPath: process.env.NODE_ENV==='production'?process.env.VUE_APP_PRE_PATH:"/",
    devServer: {
      port: 8080,
      progress: false, // vue-cli-service serve 启动进度的显示和隐藏
      headers: {
        'Access-Control-Allow-Origin': '*'
      },
  outputDir: 'intelligent-medicine-abinet',
  devServer: {
    port: 8080,
    progress: false, // vue-cli-service serve 启动进度的显示和隐藏
    headers: {
      'Access-Control-Allow-Origin': '*'
    },
    chainWebpack: config => {
      config.plugin('html')
        .tap(args => {
          args[0].alias =  process.env.VUE_APP_ALIAS
          args[0].name =  process.env.VUE_APP_TITLE
          return args
        })
  },
  chainWebpack: config => {
    config.plugin('html')
      .tap(args => {
        args[0].alias =  process.env.VUE_APP_ALIAS
        args[0].name =  process.env.VUE_APP_TITLE
        return args
      })
        config.externals( {
            vue: "Vue",
            vuex: "Vuex",
            axios: "axios",
            lodash: "_",
            "vue-router": "VueRouter",
            "vant": "vant"
        })
      config.externals( {
          vue: "Vue",
          vuex: "Vuex",
          axios: "axios",
          lodash: "_",
          "vue-router": "VueRouter",
          "vant": "vant"
      })
        const svgRule = config.module.rule("svg");
      const svgRule = config.module.rule("svg");
        // 清除已有的所有 loader。
        // 如果你不这样做,接下来的 loader 会附加在该规则现有的 loader 之后。
        svgRule.uses.clear();
      // 清除已有的所有 loader。
      // 如果你不这样做,接下来的 loader 会附加在该规则现有的 loader 之后。
      svgRule.uses.clear();
        // 添加要替换的 loader
        // svgRule.use("vue-svg-loader").loader("vue-svg-loader");
        svgRule
        .use("svg-sprite-loader")
        .loader("svg-sprite-loader")
        .options({
            symbolId: "icon-[name]"
        });
      // 添加要替换的 loader
      // svgRule.use("vue-svg-loader").loader("vue-svg-loader");
      svgRule
      .use("svg-sprite-loader")
      .loader("svg-sprite-loader")
      .options({
          symbolId: "icon-[name]"
      });
    },
    css: {
  },
  css: {
      loaderOptions: {
        postcss: {
          plugins: [
@ -60,4 +61,4 @@ module.exports = {
        }
      }
    }
  }
}