question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation: need to explain how used vue.config.js in different build modes

See original GitHub issue

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:

module.exports = {
...
    outputDir: 'dist',
    assetsDir: 'app',
    indexPath: 'app.html',
...
}

Run: # vue-cli-service build --mode development
Result:

/dist
/dist/app.html
/dist/app/js
/dist/app/css
/dist/app/img

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
vagrantircommented, Aug 22, 2018

https://github.com/vagrantir/vue-cli-test node 8, npm 6, win7 I expect that both command build similar ./dist folder, but in –mode development ./dist have plain structure without bundled css/img assets

./node_modules/.bin/vue-cli-service build
image

./node_modules/.bin/vue-cli-service build --mode development
image

5reactions
vagrantircommented, Aug 23, 2018

@LinusBorg I found solution for my case by using Vue.config.devtools in main.js and build --mode production, but it`s not clear from documentation/forum/chat. And in this solution need to additional manipulation for enabling sourceMap.

if (process.env.VUE_DEVTOOLS_ENABLED) {
    Vue.config.devtools = true;
}

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration Reference
vue.config.js is an optional config file that will be automatically loaded by @vue/cli-service if it's present in your project root (next to ...
Read more >
Custom Build Modes with Vue CLI 3
By default, Vue CLI has 3 different “pre-configured” modes: ... We can fine-tune those webpack builds by using the vue.config.js file.
Read more >
Vue.js Cli: How to Use Multiple vue.config.js Configs
It can be useful to have more than one configuration file, for example, to build several code bundles. The config file to use...
Read more >
How to direct vue-cli to put built project files in different ...
I just had to do this for a new project using the latest Vue-CLI and it was pretty simple: I just needed to...
Read more >
The build Property
Note: This config has been removed since Nuxt 2.0, please use build.loaders.vue instead. Type: Object; Default: nuxt.config.js { ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found