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

babel-plugin-universal-import

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-universal-import - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

2

package.json
{
"name": "babel-plugin-universal-import",
"version": "1.3.1",
"version": "1.3.2",
"description": "Babel plugin to transform import() into its Universal counterpart",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -122,3 +122,22 @@ <a href="https://gitter.im/Reactlandia/Lobby" target="_blank">

## Typescript and non-Babel environments
If you can't use babel, you can either copy what this plugin does above, or you can do a shorter version where you just put the important configuration key/vals on the 2nd options argument to `universal`:
```js
import universal from 'react-universal-component'
import importCss from 'babel-plugin-universal-import/importCss.js'
const load = props => Promise.all([
import( /* webpackChunkName: '[request]' */ `./${props.page}`),
importCss(page)
]).then(proms => proms[0])
const UniversalComponent = universal(load, {
chunkName: props => props.page,
resolve: props => require.resolveWeak(`./${props.page}`)
});
```
> notice `chunkName` and `resolve` as standard options on the 2nd options argument.
## Babel Server Or Webpack < 2.2.20

@@ -125,0 +144,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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