vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

Can I viewing my app on public/index.html if i cant why cant i vue isn't client-side?? #6850

Open Keremunce opened 2 years ago

Keremunce commented 2 years ago

Version

5.0.0-rc.1

Reproduction link

github.com

Environment info

System:
    OS: Windows 10 10.0.19041
    CPU: (8) x64 AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx  
  Binaries:
    Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.19041.1266.0), Chromium (96.0.1054.34)
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1
    @vue/babel-helper-vue-transform-on:  1.0.2
    @vue/babel-plugin-jsx:  1.1.1
    @vue/babel-plugin-transform-vue-jsx:  1.2.1
    @vue/babel-preset-app:  undefined (4.5.15)
    @vue/babel-preset-jsx:  1.2.4
    @vue/babel-sugar-composition-api-inject-h:  1.2.1
    @vue/babel-sugar-composition-api-render-instance:  1.2.4
    @vue/babel-sugar-functional-vue:  1.2.2
    @vue/babel-sugar-inject-h:  1.2.2
    @vue/babel-sugar-v-model:  1.2.3
    @vue/babel-sugar-v-on:  1.2.3
    @vue/cli-overlay:  4.5.15
    @vue/cli-plugin-babel: ~4.5.0 => 4.5.15
    @vue/cli-plugin-eslint: ~4.5.0 => 4.5.15
    @vue/cli-plugin-router:  4.5.15
    @vue/cli-plugin-vuex:  4.5.15
    @vue/cli-service: ~4.5.0 => 4.5.15
    @vue/cli-shared-utils:  4.5.15
    @vue/compiler-core:  3.2.22
    @vue/compiler-dom:  3.2.22
    @vue/compiler-sfc: ^3.0.0 => 3.2.22
    @vue/compiler-ssr:  3.2.22
    @vue/component-compiler-utils:  3.3.0
    @vue/devtools-api:  6.0.0-beta.20.1
    @vue/preload-webpack-plugin:  1.1.2
    @vue/reactivity:  3.2.22
    @vue/ref-transform:  3.2.22
    @vue/runtime-core:  3.2.22
    @vue/runtime-dom:  3.2.22
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.9.8 (16.8.3)
    vue-router: ^4.0.12 => 4.0.12
    vue-style-loader:  4.1.3
    vue-template-es2015-compiler:  1.9.1
    vue3-autocounter: ^1.0.6 => 1.0.6
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

Can open app with index.html

What is expected?

I wanna viewing my app on index.html(dist or public) without npm run serve. If I cant WHY? pls, tell me why. thx

What is actually happening?

Work on npm run serve but doesn't work index.html without node server

bodograumann commented 2 years ago

This would better fit into a discussion. You are also always welcome to ask question on the discord at chat.vuejs.org

To answer your question: public/index.html only contains a template, which has to be filled before being usable. You can however run npm run build to generate a purely static version in the dist folder and then open dist/index.html.