npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-cli-plugin-multiple-page

v0.2.2

Published

> A plugin that bundle multiple page based-on vue-cli. Unlike `vue-cli's pages` configuration, it's handled by sharding multiple pages into different webpack configurations

Downloads

59

Readme

vue-cli-plugin-multiple-page

A plugin that bundle multiple page based-on vue-cli. Unlike vue-cli's pages configuration, it's handled by sharding multiple pages into different webpack configurations

Usage

Install the plugin in your project created by vue-cli, if not please refer to Not Vue-CLI created Project

vue add multiple-page

Commands

Here are 3 commands for this plugin:

  1. init-config: initialize vue.config.js & Views.json two files to your project
  2. build-multi: build multiple page in parallel
  3. watch-multi: watch multiple page in parallel

You can use vue-cli-service [command] in your project

init-config

The command will be generates vue.config.jsViews.json files if your project haven't corresponding files

build-multi

The command will be build you entries where above generated configurations , and you can specify the entry by pass --key option, e.g:

vue-cli-service build-multi --key page,page1 # build page,page1 two entries

Views.json:

{
  "basePath": "resources/assets/js/views",
  "destBasePath": "public/js/v",
  "entry": {
    "page": {
      "srcPath": "page",
      "name": "index",
      "output": "page-index",
      "description": "test page"
    },
    "page1": {
      "srcPath": "page1",
      "name": "index",
      "output": "page1-index",
      "description": "test page1"
    }
  }
}

The configuration file above will generates the following corresponding paths:

  • entry: [yourProject/resources/assets/js/views/page/index.js, yourProject/resources/assets/js/views/page1/index.js]
  • output: [yourProject/public/js/v/page-index/index.js, yourProject/public/js/v/page1-index/index.js]

watch-multi

This command, like the vue-cli-service watch command, It listens for changes to the entry file of configuration by passing the specified --key to bundle (in watch mode)

Customize Configuration

The plugin provides the ability to customize the configuration so that you can programmatically expose the configuration of multiple pages by creating a file called multiple-page.config.js:

const path = require('path')
const resolve = name => path.resolve(__dirname, name)
const basePath = resolve('resources/assets/js/views')
const outputPath = resolve('public/js/v')

module.exports = {
  page: {
    entry: path.join(basePath, 'page/index.js'),
    output: path.join(outputPath, 'page-index'),
    description: 'test page',
    extract: true,
    chunkName: 'index'
  },
  page1: {
    entry: path.join(basePath, 'page1/index.js'),
    output: path.join(outputPath, 'page1-index'),
    description: 'test page1',
    chunkName: 'index'
  }
}

If you have both files (Views.jsonmultiple-page.config.js) in your root directory, The multiple-page.config.js file have a higher priority.

Not Vue-CLI created Project

If your project is not created by vue-cli. please refer to the following steps. (This scenario is suitable for older, multiple-page projects that are rendered primarily by backend template engines)

step1: Installing these dependencies in your project if you haven't installed them

yarn add @vue/cli-service vue-template-compiler --dev
yarn add vue

step2: Add the following script commands to your package.json file:

{
  "scripts": {
    "init:config": "vue-cli-service init-config",
    "watch": "vue-cli-service watch-multi",
    "build": "vue-cli-service build-multi"
  }
}

step3: Add this plugin to your project

vue add multiple-page

Finally Enjoy the same features as vue-cli

TODO

  • [] test cases