All Projects → egoist → Import Http

egoist / Import Http

Licence: mit
Import modules from URL instead of local node_modules

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Import Http

Ol3echarts
🌏 📊 ol3Echarts | a openlayers extension to echarts
Stars: ✭ 229 (-80.09%)
Mutual labels:  webpack, rollup
Vue Electron Template
An Electron & Vue.js template with Hot-reloading enabled and common Vue plugins, dev, debug and build scripts configured.
Stars: ✭ 260 (-77.39%)
Mutual labels:  webpack, rollup
Webpack
📜Some of the node tutorial -《Webpack学习笔记》
Stars: ✭ 234 (-79.65%)
Mutual labels:  webpack, module
Moment Module
Efficient Moment.js integration for Nuxt
Stars: ✭ 164 (-85.74%)
Mutual labels:  webpack, module
Ts Monorepo
Template for setting up a TypeScript monorepo
Stars: ✭ 459 (-60.09%)
Mutual labels:  webpack, rollup
Vue Plugin Template
🚀 Solid foundation to start a Vue plugin with the best developer experience and a focus on performance
Stars: ✭ 189 (-83.57%)
Mutual labels:  webpack, rollup
Harold
Compares frontend project bundles
Stars: ✭ 241 (-79.04%)
Mutual labels:  webpack, rollup
Cjstoesm
A tool that can transform CommonJS to ESM
Stars: ✭ 109 (-90.52%)
Mutual labels:  webpack, rollup
Esri Loader
A tiny library to help load ArcGIS API for JavaScript modules in non-Dojo applications
Stars: ✭ 400 (-65.22%)
Mutual labels:  webpack, rollup
Ionic Boilerplate
✨ An Ionic Starter kit featuring Tests, E2E, Karma, Protractor, Jasmine, Istanbul, Gitlab CI, Automatic IPA and APK, TypeScript 2, TsLint, Codelyzer, Typedoc, Yarn, Rollup, and Webpack 2
Stars: ✭ 309 (-73.13%)
Mutual labels:  webpack, rollup
Workflow
一个工作流平台
Stars: ✭ 1,888 (+64.17%)
Mutual labels:  webpack, rollup
Serverless Plugin Typescript
Serverless plugin for zero-config Typescript support
Stars: ✭ 611 (-46.87%)
Mutual labels:  webpack, rollup
Babel Plugin Prismjs
A babel plugin to use PrismJS with standard bundlers.
Stars: ✭ 114 (-90.09%)
Mutual labels:  webpack, rollup
Xdm
a modern MDX compiler. No runtime. With esbuild, Rollup, and webpack plugins
Stars: ✭ 206 (-82.09%)
Mutual labels:  webpack, rollup
Node Hot Loader
Hot module replacement (hot reload) for Node.js applications. Develop without server restarting.
Stars: ✭ 111 (-90.35%)
Mutual labels:  webpack, module
Modular Css
A streamlined reinterpretation of CSS Modules via CLI, API, Browserify, Rollup, Webpack, or PostCSS
Stars: ✭ 234 (-79.65%)
Mutual labels:  webpack, rollup
Vue Example
Vue.js Examples
Stars: ✭ 105 (-90.87%)
Mutual labels:  webpack, rollup
Instacam
Instant canvas video
Stars: ✭ 106 (-90.78%)
Mutual labels:  webpack, module
React Modern Library Boilerplate
Boilerplate for publishing modern React modules with Rollup
Stars: ✭ 285 (-75.22%)
Mutual labels:  rollup, module
Javascriptstudy
JavaScript的学习代码总结,高级特性、数据结构、设计模式、typescript、vue、angular、react、node、webpack、weex、小程序、tensorflow…,JavaScript是世界上最好的语言!
Stars: ✭ 529 (-54%)
Mutual labels:  webpack, module
logo

NPM version NPM downloads CircleCI donate chat

Please consider donating to this project's author, EGOIST, to show your ❤️ and support.

Introduction

  • Imports source code URLs! Like <script type="module"> and Deno but implemented as a webpack/Rollup plugin. Embracing the future :)

    import template from 'https://unpkg.com/lodash-es/template'
    
    console.log(template(`Hello <%= name %>`)({ name: 'EGOIST' }))
    

    Remote code is fetched and cached on first build, and never updated until you use the reload option. See more about Caching.

  • No more node_modules bloat, no dependency to install.

image

Install

yarn add import-http --dev

Usage

Webpack

In your webpack.config.js:

const ImportHttpWebpackPlugin = require('import-http/webpack')

module.exports = {
  plugins: [new ImportHttpWebpackPlugin()]
}

That's it, try following code:

import React from 'https://unpkg.com/react'
import Vue from 'https://unpkg.com/vue'

console.log(React, Vue)

Run webpack and it just works.

Rollup

In your rollup.config.js:

export default {
  plugins: [require('import-http/rollup')()]
}

Caching

Resources will be fetched at the very first build, then the response will be cached in ~/.cache/import-http dir. You can use the reload option to invalidate cache:

const ImportHttpWebpackPlugin = require('import-http/webpack')

module.exports = {
  plugins: [
    new ImportHttpWebpackPlugin({
      reload: process.env.RELOAD
    })
  ]
}

Then run RELOAD=true webpack to update cache.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

import-http © EGOIST, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).

Website · GitHub @EGOIST · Twitter @_egoistlily

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].