FEMessage / nuxt-micro-frontend

🎳Nuxt module for micro-frontend solution
https://deep-han.github.io/qiankun
MIT License
130 stars 27 forks source link

支持 dev server headers 设置 #7

Closed DeepenLau closed 4 years ago

DeepenLau commented 4 years ago

Why

本地微前端开发时调试

How

...
  build: {
    devMiddleware: {
      // 这个 headers 是静态资源文件的路由,这里是 /_nuxt
      headers: {
        'Access-Control-Allow-Origin': '*'
      }
    }
  },
  MFE: {
    force: true,
    path: 'example/mfe.js',
    devServer: {
      // 写自己服务的绝对路径,斜杠结尾,必填
      publicPath: '//localhost:3000/',
      // 这个 headers 会通过 addServerMiddleware 注入
      headers: {
        'Access-Control-Allow-Origin': '*'
      }
    }
  },
...
lianghx-319 commented 4 years ago

I found a better way to allow cross-origin, see #8 Welcome to give me some advice