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

Import modules isomorphically

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5K
decreased by-40.54%
Maintainers
1
Weekly downloads
 
Created
Source

vite-plugin-iso-import

Import modules isomorphically. Vite discussion for potential built-in support.

Usage

Input:

import { foo } from './client-module?client'
import { bar } from './server-module?server'

Normal build output:

import { foo } from './client-module'

SSR build output:

import { bar } from './server-module'

Installation

// vite.config.js

import { isoImport } from 'vite-plugin-iso-import'

export default defineCnfig({
  plugins: [isoImport()]
})

FAQ

Q: What happens if I use an import value that has been stripped off?

A: You'll get a usual JS error of the value being unreferenced/undefined. Instead, you should always wrap these environment-specific code with import.meta.env.SSR.

License

MIT

Keywords

FAQs

Package last updated on 11 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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