How can I create two separate bundles with vue-cli 3?

Assuming you need completely separate builds, with some shared scripts guided by your entries, you can add separate build commands. In your package.json “scripts” section: “scripts”: { “build:admin”: “vue-cli-service build –dest dist/admin src/admin/index.js, “build:public”: “vue-cli-service build –dest dist/public src/public/index.js } For admin builds, you may run: npm run build:admin and for public builds: npm run … Read more

Vue Cli 3 how to use the official PWA plugin ( Service Worker )

As already pointed out, it’s more of a “service workers” issue than a “vue cli” one. First of all, to make sure we’re on the same page, here’s what the boilerplate content of registerServiceWorker.js should look like (vue cli 3, official pwa plugin): import { register } from ‘register-service-worker’ if (process.env.NODE_ENV === ‘production’) { register(`${process.env.BASE_URL}service-worker.js`, … Read more

How to direct vue-cli to put built project files in different directories?

I just had to do this for a new project using the latest Vue-CLI and it was pretty simple: I just needed to have a file called vue.config.js at the top-level of my Vue project and within it I needed the following code: const path = require(“path”); module.exports = { outputDir: path.resolve(__dirname, “../backend/templates/SPA”), assetsDir: “../../static/SPA” … Read more

Vue cli 3 hot reload suddenly not working in browsers

My problem was WDS Console displayed: [HMR] Waiting for update signal from WDS… [WDS] Disconnected! GET http://ip:port/sockjs-node/info?t=some-number net::ERR_CONNECTION_TIMED_OUT sockjs.js?some-number Solution for me was: in package.json change “serve”: “vue-cli-service serve”, to “serve”: “vue-cli-service serve –host localhost”, or add module.exports = { devServer: { host: ‘localhost’ } } to vue.config.js 🙂

Vue Cli 3.0 where is the config file?

Where is the config files and why isn’t it anywhere in the top level folders, etc? The initial project doesn’t require the file to exist because you just created a project with fresh “default” settings that don’t require any config. Just create it yourself. it’s even mentioned in the README: Many aspects of a Vue … Read more