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
1
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 0.9.2 to 0.9.3

19

dist/index.d.ts
import type { Plugin } from 'vite';
import type { DynamicImportOptions } from './types';
export interface DynamicImportOptions {
filter?: (id: string) => false | void;
/**
* This option will change `./*` to `./** /*`
* @default true
*/
depth?: boolean;
/**
* If you want to exclude some files
* e.g `type.d.ts`, `interface.ts`
*/
onFiles?: (files: string[], id: string) => typeof files | void;
/**
* It will add `@vite-ignore`
* `import(/*@vite-ignore* / 'import-path')`
*/
viteIgnore?: (rawImportee: string, id: string) => true | void;
}
export default function dynamicImport(options?: DynamicImportOptions): Plugin;

2

dist/index.js

@@ -131,3 +131,3 @@ "use strict";

if (dyImptRutimeBody) {
code += '\n// --------- ${PLUGIN_NAME} ---------\n' + dyImptRutimeBody;
code += `\n// --------- ${PLUGIN_NAME} ---------\n` + dyImptRutimeBody;
}

@@ -134,0 +134,0 @@ return {

import type { AcornNode as AcornNode2 } from 'rollup';
export declare type AcornNode<T = any> = AcornNode2 & Record<string, T>;
export interface DynamicImportOptions {
filter?: (id: string) => false | void;
/**
* This option will change `./*` to `./** /*`
* @default true
*/
depth?: boolean;
/**
* If you want to exclude some files
* e.g `type.d.ts`, `interface.ts`
*/
onFiles?: (files: string[], id: string) => typeof files | void;
/**
* It will add `@vite-ignore`
* `import(/*@vite-ignore* / 'import-path')`
*/
viteIgnore?: (rawImportee: string, id: string) => true | void;
}
{
"name": "vite-plugin-dynamic-import",
"version": "0.9.2",
"version": "0.9.3",
"description": "Enhance Vite builtin dynamic import",

@@ -8,3 +8,4 @@ "main": "dist/index.js",

"type": "git",
"url": "git+https://github.com/vite-plugin/vite-plugin-dynamic-import.git"
"url": "git+https://github.com/caoxiemeihao/vite-plugins.git",
"directory": "packages/dynamic-import"
},

@@ -11,0 +12,0 @@ "author": "草鞋没号 <308487730@qq.com>",

@@ -68,3 +68,3 @@ # vite-plugin-dynamic-import

├── src
| ├── views
| └── views
| | ├ foo

@@ -71,0 +71,0 @@ | | | └── index.js

@@ -18,3 +18,3 @@ import path from 'path'

} from './utils'
import type { AcornNode, DynamicImportOptions } from './types'
import type { AcornNode } from './types'
import { AliasContext, AliasReplaced } from './alias'

@@ -29,2 +29,21 @@ import {

export interface DynamicImportOptions {
filter?: (id: string) => false | void
/**
* This option will change `./*` to `./** /*`
* @default true
*/
depth?: boolean
/**
* If you want to exclude some files
* e.g `type.d.ts`, `interface.ts`
*/
onFiles?: (files: string[], id: string) => typeof files | void
/**
* It will add `@vite-ignore`
* `import(/*@vite-ignore* / 'import-path')`
*/
viteIgnore?: (rawImportee: string, id: string) => true | void
}
const PLUGIN_NAME = 'vite-plugin-dynamic-import'

@@ -171,3 +190,3 @@

if (dyImptRutimeBody) {
code += '\n// --------- ${PLUGIN_NAME} ---------\n' + dyImptRutimeBody
code += `\n// --------- ${PLUGIN_NAME} ---------\n` + dyImptRutimeBody
}

@@ -174,0 +193,0 @@

import type { AcornNode as AcornNode2 } from 'rollup'
import type { Plugin } from 'vite'
export type AcornNode<T = any> = AcornNode2 & Record<string, T>
export interface DynamicImportOptions {
filter?: (id: string) => false | void
/**
* This option will change `./*` to `./** /*`
* @default true
*/
depth?: boolean
/**
* If you want to exclude some files
* e.g `type.d.ts`, `interface.ts`
*/
onFiles?: (files: string[], id: string) => typeof files | void
/**
* It will add `@vite-ignore`
* `import(/*@vite-ignore* / 'import-path')`
*/
viteIgnore?: (rawImportee: string, id: string) => true | void
}
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