Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thgh/rollup-plugin-url-import

Resolve URL imports just like Deno
https://github.com/thgh/rollup-plugin-url-import

Last synced: about 1 month ago
JSON representation

Resolve URL imports just like Deno

Awesome Lists containing this project

README

        

# Rollup plugin that resolves URL imports


Software License


Issues


Latest Version


## Installation
```
npm install --save-dev rollup-plugin-url-import
```

## Usage
```js
// rollup.config.js
import urlImport from 'rollup-plugin-url-import'

export default {
input: 'input.js',
output: { file: 'output.js', format: 'esm' },
plugins: [
urlImport()
]
}
```

```js
// input.js
import 'https://deno.land/thumb.ts'
import leftPad from 'https://dev.jspm.io/left-pad'

console.log(leftPad('test', 8))
```

### Options

The cache option is not yet implemented.

```js
urlImport({
// Cache fetched modules (default: false)
cache: true,

// Cache fetched modules in specified folder
cache: '~/.deno/deps',

// Enable output of fetched urls (default: false)
verbose: true,

// Fetch named modules from jspm.io (default: false)
jspm: true
})
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Contributing

Contributions and feedback are very welcome.

To get it running:
1. Clone the project.
2. `npm install`
3. `npm run build`
4. `npm run test`

## Credits

- [Thomas Ghysels](https://github.com/thgh)
- [All Contributors][link-contributors]

## License

The MIT License (MIT). Please see [License File](LICENSE) for more information.

[link-author]: https://github.com/thgh
[link-contributors]: ../../contributors
[rollup-plugin-url-import]: https://www.npmjs.com/package/rollup-plugin-url-import