-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Make public folder path configurable #3184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The The workflow for using Vue CLI with a backend framework is let the Vue CLI app live in its own isolated directory and (after build) target/copy your |
I know that the For the current issue I really don't care if the default name is public or not. But at least add the option to change the path - if one needs to. Your proposition (https://github.com/yyx990803/laravel-vue-cli-3) with integrating Vue CLI with a backend framework is not optimal. It works. But on a daily basis it is quite inconvenient. I work on the client and backend at the same time. This means I have to change between folders often (root project folder and client folder) respectively switch between multiple terminal sessions for running CLI commands (like |
@marvinrabe in that case you should just use the default config from Laravel (via Mix) instead of the CLI. |
No. In my opinion Laravel Mix is not really suited for SPA. Vue CLI is. But Vue CLI has one little quirk: no configurable I spend some time digging through older issues to fully understand your reasons. For future reference the reasons for not providing a configuration for the
I strongly disagree on the first 3 points. But as explained by @LinusBorg in #3061 the maintenance cost is a good reason for rejecting this feature. Thank you for taking time responding to this issue. Sources: |
Yes, your summary is basically my reason for rejecting this. Note that (1) is the whole premise for providing the CLI, so disagreeing with that means you have a different vision for what this project should be - in that case you should probably fork it. |
@marvinrabe Thank you for the config example. I have been struggling with this same problem for days. At the very least I wish I could tell vue to not copy any or at least certain files from the public folder over to the /dist. My several gigabytes of files in the /public/gallery folder takes a while to copy and it's a waste of space to make a copy of it. Something I very much do not understand is why the results of |
I also ran into this issue in the CLI. How come these two very popular frameworks (Vue.js and Laravel) have conflicting folder structures when they are so often used together? Cannot the teams cooperate together if it is a typical technology stack? @yyx990803 I see your point here. But sometimes you need to have a thin Laravel wrapper around your Vue.js SPA and you don't want to move all Vue.js code to a subfolder if that's the place where you spend the most time during development. So having it at least configurable would be a great improvement. Although the ultimate solution would be not to have any conflicts between Vue.js and Laravel default folder structure. |
I have a number of vue projects running, and to avoid boilerplate I put all common configuration in a node package called 'vue2-bootsrap', which is installed via npm and from which the vue-cli gets started:
While this works perfectly fine, the cli serve/build tasks are looking into the local vue2-bootstrap/public folder and do not respect the projects public folder index.html template or local static assets like a favicon.ico or a logo.png. It would be greate to have a |
Anyone using Laravel have a look at nuxt.js and this boilerplate: https://github.com/acidjazz/laranuxt You can create a SPA in combination with a Laravel backend without the Simply stop using vue-cli. In my opinion nuxt.js has the overall better design nonetheless. |
const path = require('path')
const publicDir = 'assets' // Defaults to 'public'
module.exports = {
chainWebpack(config) {
config.plugin('html').tap((args) => {
args[0].template = path.resolve(publicDir, 'index.html')
return args
})
/* config
.plugin('copy')
.use(require('copy-webpack-plugin'), [
[{ from: path.resolve(publicDir) }],
]) */
config
.plugin('copy')
.use(require('copy-webpack-plugin'))
.tap((args) => {
return [
[...(args[0] ? args[0] : []), { from: path.resolve(publicDir) }],
]
})
},
} |
Uh oh!
There was an error while loading. Please reload this page.
What problem does this feature solve?
Renaming or moving the public folder in order to use vue-cli alongside other frameworks (e.g. Laravel).
Yes, it is possible to achieve it with this configuration:
But for such a simple configuration this feels ridiculous.
What does the proposed API look like?
Specify the public directory path in the
vue.config.js
The text was updated successfully, but these errors were encountered: