Akryum / Akryum/vue-cli-plugin-ssr

Documentation around webpack configuration unclear

Đang mở
#94 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
441
Fork
69
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**EDIT:** - I was running under 0.3.0 due to #57 not working, so I'm unblocked (although I'm having to go through some gymnastics in order to properly set the flag myself). I think this issue is still valid as a full vue.config.js would be more clear.

The documentation is unclear how exactly to leverage `VUE_CLI_SSR_TARGET` properly. It introduces a variable `api` that is unexplained. Could we expand the context to a full vue.config.js file that contains the necessary webpack configuration?

My use case is having a different URL used in a dockerized app -- the client bundle uses the full domain, while the server bundle uses the internal service name which is faster.

Here's my stripped down vue.config.js for reference:
```js
const path = require('path')
const fs = require('fs')
const express = require('express')

module.exports = {
devServer: {
port: 3000
},
pluginOptions: {
ssr: {
host: "0.0.0.0",
port: 3000,
// Entry for each target
entry: target => `./src/entry-${target}.ts`,
},
},
configureWebpack: config => {
console.log(`configure VUE_CLI_SSR_TARGET: ${process.env.VUE_CLI_SSR_TARGET}`)
return config;
},
chainWebpack: config => {
console.log(`chain VUE_CLI_SSR_TARGET: ${process.env.VUE_CLI_SSR_TARGET}`)
return config
}
}
```

And the console output:
```
yarn run v1.15.2
$ vue-cli-service ssr:build
chain VUE_CLI_SSR_TARGET: undefined
configure VUE_CLI_SSR_TARGET: undefined
chain VUE_CLI_SSR_TARGET: undefined
configure VUE_CLI_SSR_TARGET: undefined
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.