一覧へ戻る
osdevisnot/rollup-plugin-unpkg(新しいタブで開きます)
主要言語: JavaScript
A rollup plugin to convert ES imports to UNPKG urls.
- star 数
- 11
- watcher 数
- 3
- fork 数
- 4
- issue 数
- 1
- 最終更新
- 2021/02/27
主要言語: JavaScript
A rollup plugin to convert ES imports to UNPKG urls.
A rollup plugin to convert ES imports to UNPKG urls.
Add this plugin to rollup.config.js:
const unpkg = require('rollup-plugin-unpkg'); export default { input: 'src/main.js', output: { file: 'bundle.js', format: 'cjs' }, plugins: [unpkg()] };
package.json dependencies:
"dependencies": { "@vanillajs/store": "^0.1.7", "superfine": "^6.0.1" },
Input Code:
import { patch, h } from 'superfine'; import store from '@vanillajs/store';
Output Code:
import { patch, h } from 'https://unpkg.com/superfine@6.0.1?type=module'; import store from 'https://unpkg.com/@vanillajs/store@0.1.7?type=module';
Inspired from this twitter conversation and a follow up gist