Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-router-lazy-replace-loader

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-router-lazy-replace-loader

vue-router 打包替换为懒加载方式

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

webpac-dll-loader

vue-router 开发环境是用同步加载,生产环境使用异步加载

  • 开发环境vue-router配置
const route = [{
	path: '/',
	name: 'index',
	meta: {
		title: '首页路由',
	},
	component: require('./pages/index/index.vue').default
}]

使用方法

npm install vue-router-lazy-replace-loader --save-dev

编译 webpack.product.config.js 配置新增loader配置 例如:


config.module.rules = (config.module.rules || []).concat([
	{
        //vue-router 生产环境替换为懒加载
        test: /router\.js$/,
        loader: 'vue-router-lazy-replace-loader',
        exclude: "/node_modules/",
        options:{
            version:'v1'
        }
    }
])

参数说明

  • version :vue-loader 14以下版本都是用 v1

Keywords

FAQs

Package last updated on 17 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc