xp-forge / frontend

Web frontends
1 stars 1 forks source link

Add support for remote dependencies #27

Closed thekid closed 3 years ago

thekid commented 3 years ago

This pull request adds support for remote dependencies, that is, dependencies downloaded from a HTTP(S) location. This feature completes local dependencies implemented in #20.

Example

The following shows a package.json using this feature.

{
  "dependencies": {
    "fomantic-ui": "^2.8",
    "jquery": "^3.6"
  },
  "bundles": {
    "vendor": {
      "jquery": "dist/jquery.min.js",
      "fomantic-ui": "dist/semantic.min.js | dist/semantic.min.css",
      "https://cdn.amcharts.com/lib/4": "core.js | charts.js | themes/animated.js"
    }
  }
}

Reasoning

While amCharts also exists on JSDelivr, the files there are not pre-compiled and would need to be pre-processed, e.g. with Webpack. However, they also provide their own CDN (see here) which includes (quote) "ready-to-include CDN resources".

thekid commented 3 years ago

Released in https://github.com/xp-forge/frontend/releases/tag/v3.6.0