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.0.2 to 0.1.0

dist/index.js

19

package.json
{
"name": "vite-plugin-iso-import",
"description": "Import modules isomorphically",
"version": "0.0.2",
"version": "0.1.0",
"author": "Bjorn Lu",
"license": "MIT",
"type": "module",
"types": "./index.d.ts",
"main": "./index.cjs",
"module": "./index.js",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"exports": {
"import": "./index.js",
"require": "./index.cjs"
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"files": [
"index.js",
"index.cjs",
"dist/index.js",
"dist/index.mjs",
"index.d.ts"

@@ -35,3 +34,3 @@ ],

"scripts": {
"build": "rollup index.js -f cjs -o index.cjs -e magic-string,es-module-lexer",
"build": "rollup -c",
"test-dev": "vite --debug",

@@ -41,2 +40,3 @@ "test-build": "pnpm test-build:client && pnpm test-build:server",

"test-build:server": "vite build --debug --outDir test-dist/server --ssr test/main.js",
"why-ts-plugin": "node scripts/createFacadeTsPlugin.js",
"prepublishOnly": "pnpm build"

@@ -51,4 +51,5 @@ },

"rollup": "^2.53.1",
"typescript": "^4.3.5",
"vite": "^2.4.1"
}
}

@@ -40,8 +40,22 @@ # vite-plugin-iso-import

Q: What happens if I use an import value that has been stripped off?
> 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`.
> Q: Using `?client` and `?server` loses intellisense.
A: The library exports a custom TypeScript plugin that fixes it. Simply update your `jsconfig.json` or `tsconfig.json` like so:
```json
{
"compilerOptions": {
"plugins": [{ "name": "vite-plugin-iso-import" }]
}
}
```
And update VSCode's `settings.json` with `"typescript.tsserver.pluginPaths": ["."]`. (Optional if using workspace Typescript version).
## License
MIT
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