New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-iso-import

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.1.2 to 0.1.3

10

dist/index.js

@@ -32,7 +32,11 @@ 'use strict';

},
async transform(code, id, ssr) {
async transform(code, id, opts) {
// Support breaking change in Vite 2.7
// The third argument now contains an object with ssr property, instead of just the ssr boolean
const ssr = opts === true || opts?.ssr;
await esModuleLexer.init;
let _s;
const s = () => _s || (_s = new MagicString__default['default'](code));
const s = () => _s || (_s = new MagicString__default["default"](code));
const [imports] = esModuleLexer.parse(code);

@@ -164,3 +168,3 @@

exports['default'] = tsPlugin;
exports["default"] = tsPlugin;
exports.isoImport = isoImport;
{
"name": "vite-plugin-iso-import",
"description": "Import modules isomorphically",
"version": "0.1.2",
"version": "0.1.3",
"author": "Bjorn Lu",

@@ -39,6 +39,2 @@ "license": "MIT",

"build": "rollup -c",
"test-dev": "vite --debug",
"test-build": "pnpm test-build:client && pnpm test-build:server",
"test-build:client": "vite build --debug --outDir test-dist/client",
"test-build:server": "vite build --debug --outDir test-dist/server --ssr test/main.js",
"why-ts-plugin": "node scripts/createFacadeTsPlugin.js",

@@ -48,11 +44,11 @@ "prepublishOnly": "pnpm build"

"dependencies": {
"es-module-lexer": "^0.7.1",
"es-module-lexer": "^0.9.3",
"magic-string": "^0.25.7"
},
"devDependencies": {
"@types/node": "^16.4.12",
"rollup": "^2.56.0",
"typescript": "^4.3.5",
"vite": "^2.4.4"
"@types/node": "^17.0.2",
"rollup": "^2.61.1",
"typescript": "^4.5.4",
"vite": "^2.7.6"
}
}

@@ -67,7 +67,19 @@ # vite-plugin-iso-import

```ts
// global.d.ts (are any ambient dts file)
declare module 'lodash-es?client' {
// global.d.ts (or any ambient dts file)
// default export
declare module 'camelcase?client' {
import all from 'camelcase'
export = all
}
// named export
declare module 'lodash-es?server' {
import * as all from 'lodash-es'
export = all
}
// fallback
declare module '*?client'
declare module '*?server'
```

@@ -74,0 +86,0 @@

Sorry, the diff of this file is not supported yet

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