vite-plugin-multi-pages
Advanced tools
Comparing version
import { PluginOption } from 'vite'; | ||
import { Rewrite } from 'connect-history-api-fallback'; | ||
/** | ||
* MPA Plugin options. | ||
*/ | ||
interface MpaOptions { | ||
/** | ||
* defaultOpenPage | ||
* @default true | ||
* @example / (root path) | true (first page) | test-two | ||
*/ | ||
defaultOpenPage: '/' | boolean | string; | ||
/** | ||
* scanning dir | ||
* @default src/pages | ||
*/ | ||
scanDir: string; | ||
/** | ||
* scanFile | ||
* @default 'main.{js,ts,jsx,tsx}' | ||
*/ | ||
scanFile: string; | ||
/** | ||
* html fileName | ||
* @default 'index.html' | ||
*/ | ||
filename: string; | ||
/** | ||
* default included entry | ||
* @default '' | ||
*/ | ||
defaultEntries: string; | ||
/** | ||
* rewrite rule list | ||
* @default [] | ||
*/ | ||
rewrites: Rewrite[]; | ||
/** | ||
* open or build a specific page under scanDir | ||
* @default '' | ||
* @example test-one,test-twos | ||
*/ | ||
specialPageNames: string; | ||
/** | ||
* ignore open or build a specific page under scanDir | ||
* @default '' | ||
* @example test-twos | ||
*/ | ||
ignorePageNames: string; | ||
@@ -52,0 +13,0 @@ } |
{ | ||
"name": "vite-plugin-multi-pages", | ||
"version": "0.0.10", | ||
"version": "0.0.12", | ||
"description": "Multi Page for vite", | ||
"keywords": [ | ||
"vite-plugin", | ||
"mpa", | ||
"MPA", | ||
"multi-page" | ||
], | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts" | ||
} | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"author": "953212389@qq.com", | ||
"scripts": { | ||
"build": "tsup src/index.ts --format esm,cjs --dts", | ||
"test": "cd example/vite-plugin-demo && pnpm i && pnpm dev", | ||
"pub": "npm version patch && pnpm build && npm publish --no-git-checks", | ||
"git": "git commit -m 'docs: update mess' && git push" | ||
"author": { | ||
"name": "wfly", | ||
"url": "https://github.com/Miofly", | ||
"email": "953212389@qq.com" | ||
}, | ||
"license": "MIT", | ||
"keywords": [ | ||
"vite-plugin", | ||
"mpa", | ||
"MPA", | ||
"multi-page" | ||
], | ||
"peerDependencies": { | ||
"vite": "^2.0.0 || ^3.0.0 || ^4.0.0", | ||
"typescript": ">=4.0.0" | ||
}, | ||
"dependencies": { | ||
"connect-history-api-fallback": "2.0.0", | ||
"yargs": "17.5.1" | ||
"yargs": "17.7.1" | ||
}, | ||
"devDependencies": { | ||
"unbuild": "2.0.0", | ||
"@vft/tsconfig": "*", | ||
"@types/connect-history-api-fallback": "1.3.5", | ||
"@types/node": "18.7.1", | ||
"@types/yargs": "17.0.11", | ||
"tsup": "6.2.1", | ||
"typescript": "4.7.4", | ||
"vite": "3.0.5" | ||
"@types/yargs": "17.0.22", | ||
"fast-glob": "^3.2.12" | ||
}, | ||
@@ -41,3 +53,12 @@ "homepage": "https://github.com/Miofly/vite-plugin-multi-pages", | ||
"url": "git@github.com:Miofly/vite-plugin-multi-pages.git" | ||
}, | ||
"scripts": { | ||
"stub": "unbuild --stub", | ||
"dev": "pnpm stub", | ||
"build": "pnpm clean:dist && pnpm -F @vft/script ts:common", | ||
"pub": "pnpm build && tsx ../../scripts/build/src/publish.ts --pkg vite-plugin/vite-plugin-multi-pages", | ||
"clean": "pnpm /^clean:/", | ||
"clean:dist": "rimraf dist", | ||
"clean:node_modules": "rimraf node_modules" | ||
} | ||
} | ||
} |
@@ -25,5 +25,5 @@ # vite-plugin-multi-pages | ||
export default defineConfig({ | ||
plugins: [ | ||
mpa(/* options */), | ||
], | ||
plugins: [ | ||
mpa(/* options */), | ||
], | ||
}) | ||
@@ -30,0 +30,0 @@ ``` |
@@ -20,2 +20,3 @@ # vite-plugin-multi-pages | ||
**vite.config.ts** | ||
```typescript | ||
@@ -25,5 +26,5 @@ import mpa from 'vite-plugin-multi-pages' | ||
export default defineConfig({ | ||
plugins: [ | ||
mpa(/* options */), | ||
], | ||
plugins: [ | ||
mpa(/* options */), | ||
], | ||
}) | ||
@@ -36,40 +37,40 @@ ``` | ||
export interface MpaOptions { | ||
/** | ||
* 默认打开页面 | ||
* @default true | ||
* @example / (root path) | true (first page) | test-two | ||
*/ | ||
defaultOpenPage: '/' | boolean | string; | ||
/** | ||
* 多页面目录 | ||
* @default src/pages | ||
*/ | ||
scanDir: string; | ||
/** | ||
* 文件入口 | ||
* @default 'main.{js,ts,jsx,tsx}' | ||
*/ | ||
scanFile: string; | ||
/** | ||
* html 文件名 | ||
* @default 'index.html' | ||
*/ | ||
filename: string; | ||
/** | ||
* 路由匹配规则 | ||
* @default '' | ||
*/ | ||
rewrites: Rewrite[] | ||
/** | ||
* 打包或启动特定的页面 | ||
* @default '' | ||
* @example test-one,test-twos | ||
*/ | ||
specialPageNames: string; | ||
/** | ||
* 忽略打包或启动特定的页面 | ||
* @default '' | ||
* @example test-twos | ||
*/ | ||
ignorePageNames: string; | ||
/** | ||
* 默认打开页面 | ||
* @default true | ||
* @example / (root path) | true (first page) | test-two | ||
*/ | ||
defaultOpenPage: '/' | boolean | string; | ||
/** | ||
* 多页面目录 | ||
* @default src/pages | ||
*/ | ||
scanDir: string; | ||
/** | ||
* 文件入口 | ||
* @default 'main.{js,ts,jsx,tsx}' | ||
*/ | ||
scanFile: string; | ||
/** | ||
* html 文件名 | ||
* @default 'index.html' | ||
*/ | ||
filename: string; | ||
/** | ||
* 路由匹配规则 | ||
* @default '' | ||
*/ | ||
rewrites: Rewrite[] | ||
/** | ||
* 打包或启动特定的页面 | ||
* @default '' | ||
* @example test-one,test-twos | ||
*/ | ||
specialPageNames: string; | ||
/** | ||
* 忽略打包或启动特定的页面 | ||
* @default '' | ||
* @example test-twos | ||
*/ | ||
ignorePageNames: string; | ||
} | ||
@@ -84,3 +85,5 @@ ``` | ||
- 配合 `vite-plugin-html-template-mpa` 自动生成 `index.html` 模板插件使用: [https://github.com/Miofly/vite-plugin-html-template-mpa](https://github.com/Miofly/vite-plugin-html-template-mpa) | ||
- 配合 `vite-plugin-vconsole-mpa` 自动配置 `vconsole`: [https://github.com/Miofly/vite-plugin-vconsole-mpa](https://github.com/Miofly/vite-plugin-vconsole-mpa) | ||
- 配合 `vite-plugin-html-template-mpa` 自动生成 `index.html` | ||
模板插件使用: [https://github.com/Miofly/vite-plugin-html-template-mpa](https://github.com/Miofly/vite-plugin-html-template-mpa) | ||
- 配合 `vite-plugin-vconsole-mpa` | ||
自动配置 `vconsole`: [https://github.com/Miofly/vite-plugin-vconsole-mpa](https://github.com/Miofly/vite-plugin-vconsole-mpa) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
5
-16.67%7
16.67%4
-60%18528
-95.28%4
100%433
-96.01%2
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
Updated