thgh / rollup-plugin-url-import

Resolve URL imports just like Deno

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rollup plugin that resolves URL imports

Software License Issues Latest Version

Installation

npm install --save-dev rollup-plugin-url-import

Usage

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

export default {
  input: 'input.js',
  output: { file: 'output.js', format: 'esm' },
  plugins: [
    urlImport()
  ]
}
// 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.

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 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

License

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

About

Resolve URL imports just like Deno

License:MIT License


Languages

Language:JavaScript 100.0%