Skip to content

Adicwu/vrouter-module-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vrouter-moudle-plugin

This plugin is based on vue and splits its router to achieve on-demand packaged runs

Used to indirectly deal with the problem of slow webpack hot updates when there are too many routes

Getting Started

To begin, you'll need to install vrouter-moudle-plugin:

npm install vrouter-moudle-plugin --save-dev

or

yarn add -D vrouter-moudle-plugin

or

pnpm add -D vrouter-moudle-plugin

Must

We need the following structure for the project directory

-- product name (Your project folder)
  -- src
    -- entry
      -- entry name (A page entry folder)
        -- router
          -- index.js (The route file for this entry)
    -- modules
      -- module.json (Module usage configuration)
      -- module name (A module folder)
        -- router.js (The module's route entry file)

Options

root

  • Type:
type root = string;
  • For Exmaple
const path = require('path');
const VrouteModulePlugin = require('vrouter-module-plugin')
// ....
plugins: [
  new VrouteModulePlugin({
    root: path.resolve('./src')
  })
]
// ....

Used to determine the root of this plugin.

About

A webpack module division plugin for vue-router

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published