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

vite-plugin-dynamic-import

Package Overview
Dependencies
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-dynamic-import - npm Package Compare versions

Comparing version 1.2.7 to 1.3.0

dist/dynamic-import-to-glob.d.ts

30

package.json
{
"name": "vite-plugin-dynamic-import",
"version": "1.2.7",
"version": "1.3.0",
"description": "Enhance Vite builtin dynamic import",
"type": "module",
"main": "index.js",
"types": "types",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./index.js",
"require": "./index.cjs"
}
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./*": "./*"
},

@@ -23,3 +24,3 @@ "repository": {

"build": "vite build",
"test": "vite -c test/vite.config.ts",
"test": "vitest run",
"types": "tsc",

@@ -29,9 +30,14 @@ "prepublishOnly": "npm run build"

"dependencies": {
"acorn": "^8.8.2",
"es-module-lexer": "^1.2.1",
"fast-glob": "^3.2.12"
},
"devDependencies": {
"@ant-design/icons-svg": "^4.2.1",
"@types/node": "^18.11.18",
"node-fetch": "^3.3.0",
"typescript": "^4.9.4",
"vite": "^4.0.4",
"vite-plugin-utils": "^0.4.0"
"vite": "^4.3.2",
"vite-plugin-utils": "^0.4.2",
"vitest": "^0.30.1"
},

@@ -45,6 +51,4 @@ "keywords": [

"files": [
"types",
"index.cjs",
"index.js"
"dist"
]
}

@@ -36,2 +36,16 @@ # vite-plugin-dynamic-import

#### node_modules
```js
dynamicImport({
filter(id) {
// `node_modules` is exclude by default, so we need to include it explicitly
// https://github.com/vite-plugin/vite-plugin-dynamic-import/blob/v1.3.0/src/index.ts#L133-L135
if (/node_modules\/(?!\.vite\/)/.test(id)) {
return true
}
}
})
```
## API

@@ -43,3 +57,3 @@

export interface Options {
filter?: (id: string) => false | void
filter?: (id: string) => boolean | void
/**

@@ -52,5 +66,5 @@ * ```

* see https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#how-it-works
* ```
*
* default true
* ```
* @defaultValue true
*/

@@ -64,6 +78,7 @@ loose?: boolean

/**
* It will add `@vite-ignore`
* `import(/*@vite-ignore* / 'import-path')`
* Custom importee
*
* e.g. - append `\/*@vite-ignore*\/` in front of importee to bypass to Vite
*/
viteIgnore?: (rawImportee: string, id: string) => true | void
onResolve?: (rawImportee: string, id: string) => typeof rawImportee | void
}

@@ -70,0 +85,0 @@ ```

@@ -36,3 +36,16 @@ # vite-plugin-dynamic-import

#### node_modules
```js
dynamicImport({
filter(id) {
// 默认会排除 `node_modules`,所以必须显式的包含它
// https://github.com/vite-plugin/vite-plugin-dynamic-import/blob/v1.3.0/src/index.ts#L133-L135
if (/node_modules\/(?!\.vite\/)/.test(id)) {
return true
}
}
})
```
## API

@@ -44,3 +57,3 @@

export interface Options {
filter?: (id: string) => false | void
filter?: (id: string) => boolean | void
/**

@@ -64,6 +77,7 @@ * ```

/**
* 将会在 import 中添加 `@vite-ignore`
* `import(/*@vite-ignore* / 'import-path')`
* 自定义 importee
*
* e.g. - 在 importee 前面插入 `\/*@vite-ignore*\/` 绕过 Vite
*/
viteIgnore?: (rawImportee: string, id: string) => true | void
onResolve?: (rawImportee: string, id: string) => typeof rawImportee | void
}

@@ -70,0 +84,0 @@ ```

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