vue-cli-plugin-pages

vue-cli 3 plugin to build multi-page application
1,204 12
Install
npm install vue-cli-plugin-pages
Latest Version:1.1.6
License:MIT
Last Updated:Jul 11, 2023
Links: GitHub  ·  npm
Maintainer: aircity

English | 简体中文

vue-cli-plugin-pages

This is a vue-cli 3.x plugin to build multi-page application.

🔗 Table of contents

✨ Features

  • Generate multi-page pages config.(Get the entries and filenames through src/views/**/app.js)
{
  "index": {
    "entry": "src/views/index/app.js",
    "filename": "index.html",
    "template": "public/index.html"
  },
  "preview": {
    "entry": "src/views/preview/app.js",
    "filename": "preview.html",
    "template": "public/index.html"
  },
  "multi-page~home": {
    "entry": "src/views/multi-page/home/app.js",
    "filename": "multi-page/home.html",
    "template": "public/index.html"
  },
  "multi-page~subpage": {
    "entry": "src/views/multi-page/subpage/app.js",
    "filename": "multi-page/subpage.html",
    "template": "public/index.html"
  }
}
  • Generate multi-page location to logs/location.json.
{
  "route": [
    { "name": "Index Page", "chunk": "index", "location": "index.html" },
    { "name": "Index Page", "chunk": "preview", "location": "preview.html" },
    {
      "name": "Home Page",
      "chunk": "multi-page~home",
      "location": "multi-page/home.html"
    },
    {
      "name": "Subpage",
      "chunk": "multi-page~subpage",
      "location": "multi-page/subpage.html"
    }
  ]
}
  • Generate multi-page directory tree to logs/tree.json.
{
  "path": "#",
  "name": "views",
  "children": [
    {
      "path": "index.html",
      "name": "Index Page",
      "children": [],
      "size": 135,
      "type": "file",
      "extension": ".js",
      "merged": true
    },
    {
      "path": "#",
      "name": "Multi Page",
      "children": [
        {
          "path": "multi-page/home.html",
          "name": "Home Page",
          "children": [],
          "size": 135,
          "type": "file",
          "extension": ".js",
          "merged": true
        },
        {
          "path": "multi-page/subpage.html",
          "name": "Subpage",
          "children": [],
          "size": 135,
          "type": "file",
          "extension": ".js",
          "merged": true
        }
      ],
      "size": 270,
      "type": "directory"
    },
    {
      "path": "preview.html",
      "name": "Index Page",
      "children": [],
      "size": 135,
      "type": "file",
      "extension": ".js",
      "merged": true
    }
  ],
  "size": 540,
  "type": "directory"
}

🔨 Usage

:warning: Make sure you have vue-cli 3.x.x:

vue --version

If you don't have a project created with vue-cli 3.x yet:

vue create my-new-app

Navigate to the newly created project folder and add the cli plugin:

cd my-new-app
vue add pages

Start your app:

npm run serve

Related Packages

vue-cli-plugin-moment

moment.js plugin for vue-cli

28,960 15
@urbanhire.com/vuesable

Vuesable is urbanhire vue component.

877
vue-cli-plugin-nid

这是宁皓网内部项目使用的一个 Vue CLI 插件,在使用了 TypeScript 的 Vue 项目里,可...

778 0

Version History

Version Released License
1.1.6 MIT
1.1.5 MIT
1.1.4 MIT
1.1.3 MIT
1.1.2 MIT
Pre-releases (1)
Version Released License
1.0.0-beta.0 MIT