Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/biyuqi/vue-multiple-pages
多页面vue项目,支持打包后每个页面也单独文件夹(具体请看README)
https://github.com/biyuqi/vue-multiple-pages
vue vue-cli4 vue-multi-page vue-multi-pages vue-multipage vue2
Last synced: 10 days ago
JSON representation
多页面vue项目,支持打包后每个页面也单独文件夹(具体请看README)
- Host: GitHub
- URL: https://github.com/biyuqi/vue-multiple-pages
- Owner: BiYuqi
- Created: 2018-03-29T02:37:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-13T22:54:09.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T00:19:14.670Z (25 days ago)
- Topics: vue, vue-cli4, vue-multi-page, vue-multi-pages, vue-multipage, vue2
- Language: Vue
- Homepage: https://biyuqi.github.io/vue-multiple-pages/
- Size: 2.43 MB
- Stars: 11
- Watchers: 1
- Forks: 11
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Vue Multiple Pages 👋
> [Vue多页面](https://github.com/BiYuqi/vue-multiple-pages)配置实例
[打包后按页面输出](https://github.com/BiYuqi/vue-multiple-pages/tree/support-build-nest-folder)
## Mutiple Setting
```js
const path = require('path')
const glob = require('glob')const generateEntries = () => {
// 默认查询多页面地址
const PATH_ENTRY = path.resolve(__dirname, './src/pages')
// 约定构建出的页面用folder名字,默认入口为每个页面的main.js
const entryFilePaths = glob.sync(PATH_ENTRY + '/**/main.js')
const entry = {}
entryFilePaths.forEach((filePath) => {
const filename = filePath.match(/([^/]+)\/main\.js$/)[1]
entry[filename] = {
entry: filePath,
template: 'public/index.html',
filename: `${filename}.html`,
// title可不传,每个页面单独设置
title: `${filename} Page`,
chunks: ['chunk-vendors', 'chunk-common', filename]
}
})return entry
}module.exports = {
generateEntries
}
```## Usage
``` bash
git clone https://github.com/BiYuqi/vue-multiple-pages.gitcd vue-multiple-pages
yarn install
yarn run serve
yarn run build
```