@jswork/next-try-require

1.0.3 • Public • Published

next-try-require

Check if a dependency exists with webpack

version license size download

installation

npm install -S @jswork/next-try-require

usage

└── medias
    ├── animation.tsx
    ├── audio.tsx
    ├── document.tsx
    ├── image.tsx
    ├── unknown.tsx
    └── video.tsx
import '@jswork/next-try-require';

// .${context}${path}
// .${context}${defaults}
// @${context}${path}
// @${context}${defaults}

const MediaComponent = nx.tryRequire(
  mediaType,
  'unknown',
  { context: '/medias/'}
);

<MediaComponent model={model}/>

license

Code released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @jswork/next-try-require

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

5.38 kB

Total Files

5

Last publish

Collaborators

  • afeiship