简体   繁体   中英

Public vs src directories (vue-cli)

The default directory structure when using vue-cli contains a 'public' directory and 'src' directory. The public directory contains index.html. What exactly is the purpose of putting index.html in the public directory instead of src? What are other examples of files that should go in public?

Files placed in the public folder are static and will not be processed by webpack.

"Placed in the public directory and referenced via absolute paths. These assets will simply be copied and not go through webpack"

Source: https://cli.vuejs.org/guide/html-and-static-assets.html#static-assets-handling

Example may include: Favicon, icons for PWA, robots.txt, manifest.json... Just to name a few.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM