-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Documentation: need to explain how used vue.config.js in different build modes #2327
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 config file surely isn't "ignored". Your issue doesn't seem to be a feature request but rather a bug report, about a behaviour that you feel is wrong or should be documented better. Unfortunately, you did not provide a reproduction of the behaviour that you feel is wrong? And I don't understand your explanation. Please provide a repository that clearly demonstrates what your problem is. |
https://github.com/vagrantir/vue-cli-test
|
I`ve got near to expected rusult, by adding next config options:
Result not the same as I expected, but very similar and index.html contain correct links to the js/css files. |
@LinusBorg I found solution for my case by using Vue.config.devtools in main.js and
Why build doesn`t work as "expected" in any mode? As for me, "expected" mean the same output result, which managed by .env variables. At least, it would be good to explain deeper in documentation, why "bulid --mode modeName" makes different result. |
Just an added example of this issue: I typically use Vue.js in conjunction with ASP.NET, and in order to get this to work properly, Vue needs to spit out CSHTML and not HTML (simple ext. change), and output the CSHTML file into the appropriate directory within the "Views" directory at the root of the project, it also needs to output assets I want to use Vue.js devtools to inspect my site, however when I build my project in development mode, it definitely ignores my Vue.config.js file (except configureWebpack, and the outputDir, everything else seems to be disregarded): const path = require('path');
module.exports = {
// baseUrl: '/content',
outputDir: '../Views/App',
assetsDir: '../../Content',
indexPath: 'Index.cshtml',
configureWebpack: {
resolve: {
alias: {
"Assets": path.resolve(__dirname, "src/assets"),
"Mixins": path.resolve(__dirname, "src/mixins"),
"Views": path.resolve(__dirname, "src/views"),
"Components": path.resolve(__dirname, "src/components")
}
}
}
} As you can imagine, the resultant build does not work; it outputs the assets (without content hashes in the names) and the HTML (not CSHTML) all to the same directory ("Views/App") I am using Vue CLI Service version 3.1.1 ETA: Just tried, same issue exists with CLI version 3.5.1 |
Not saying i don't believe you, you surely experience what you describe. but this kind of statement doesn't allow us to do anything about your issue, so unless you can provide a project that we can run and see for ourselves, please don't expect this issue to move anywhere. |
I'll put up a minimal repo in a moment. |
Here you are. I pretty much just copied the exact same config from above into a brand new Vue project. |
Thanks, will have a look tonight. |
+1 also experiencing this issue. However, I only have issue with the However, the following workaround to use multipage mode seems to work: // vue.config.js
module.exports = {
publicPath: '++static++crisko.www',
// indexPath: 'theme.pt'
pages: {
theme: {
entry: 'src/main.js',
template: 'public/index.html',
filename: 'theme.pt'
}
}
} |
I am facing a similar situation. I need to output a Classic ASP include file. I am able to work around using @arterrey 's method combined with some additional rules, to fit my needs. (I don't want the 'head' tag.) The "pages" config approach, will generate an "index.html" that will never be used. Adding in the "indexPath" rule will not produce this "index.html" file for production mode, but still produces it in development mode since "indexPath" is ignored. My project here: https://github.com/fnick851/vue-cli-for-classic-asp |
I just found a way to make it work. https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-plugin
my problem is that.
I want to tell Vue that all my JS / CSS / IMG (Assets) are found on /admin folder
EDIT found a fix for vue-router
P.S. if you're wondering if I'm using Laravel with this setup, then yes I am. my Vue-Cli project is found on <laravel_root>/client/<vue_project> |
What problem does this feature solve?
No any explanation in docs, why in "build --mode development" ignored vue.config.js file.
And how developer can build app with bundled assets and enabled vue-dev-tools
What does the proposed API look like?
vue.config.js:
Run:
# vue-cli-service build --mode development
Result:
The text was updated successfully, but these errors were encountered: