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

vite-plugin-externals

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-externals - npm Package Compare versions

Comparing version 0.1.7 to 0.2.0

8

dist/es/index.js

@@ -26,5 +26,9 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {

if (useWindow === false) {
return externalValue;
return typeof externalValue === 'string' ? externalValue : externalValue.join('.');
}
return `window['${externalValue}']`;
if (typeof externalValue === 'string') {
return `window['${externalValue}']`;
}
const vals = externalValue.map((val) => `['${val}']`).join('');
return `window${vals}`;
};

@@ -31,0 +35,0 @@ })((_a = userOptions.useWindow) !== null && _a !== void 0 ? _a : true);

import { TransformPluginContext } from 'rollup';
export declare type Externals = Record<string, string>;
export declare type ExternalValue = string | string[];
export declare type Externals = Record<string, ExternalValue>;
export interface Options {

@@ -4,0 +5,0 @@ disableSsr?: boolean;

@@ -32,5 +32,9 @@ "use strict";

if (useWindow === false) {
return externalValue;
return typeof externalValue === 'string' ? externalValue : externalValue.join('.');
}
return `window['${externalValue}']`;
if (typeof externalValue === 'string') {
return `window['${externalValue}']`;
}
const vals = externalValue.map((val) => `['${val}']`).join('');
return `window${vals}`;
};

@@ -37,0 +41,0 @@ })((_a = userOptions.useWindow) !== null && _a !== void 0 ? _a : true);

import { TransformPluginContext } from 'rollup';
export declare type Externals = Record<string, string>;
export declare type ExternalValue = string | string[];
export declare type Externals = Record<string, ExternalValue>;
export interface Options {

@@ -4,0 +5,0 @@ disableSsr?: boolean;

{
"name": "vite-plugin-externals",
"version": "0.1.7",
"version": "0.2.0",
"description": "externals plugin for vite",

@@ -5,0 +5,0 @@ "author": "crcong",

@@ -41,2 +41,4 @@ # vite-plugin-externals

'react-dom': 'ReactDOM',
// value support chain, tranform to window['React']['lazy']
lazy: ['React', 'lazy']
}),

@@ -43,0 +45,0 @@ ]

@@ -41,2 +41,4 @@ # vite-plugin-externals

'react-dom': 'ReactDOM',
// 支持值链式取值,会转换成 window['React']['lazy']
lazy: ['React', 'lazy']
}),

@@ -43,0 +45,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