Akryum / Akryum/vue-cli-plugin-ssr
Documentation around webpack configuration unclear
- Lenguaje dominante
- JavaScript
- Estrellas
- 441
- Forks
- 69
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
**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
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.