opencomponents / oc-template-react

⚛️ Module for handling React templates in OC
MIT License
23 stars 16 forks source link

Allow external overrides #647

Closed kmcrawford closed 3 years ago

kmcrawford commented 3 years ago

add the following you your component's package.json configuration:

"oc": {
 "files": {
    "template": {
      "src": "app.js",
      "type": "oc-template-react",
      "externals": [
        {
          "name": "prop-types",
          "global": "PropTypes",
          "url": "https://mydomain.com/prop-types@15.7.2/prop-types.min.js"
        }....,

This allows custom overrides for externals to be used during oc package and oc publish to write the template.js with custom domains & paths for externals.

Closing issues closes #1187

pbazydlo commented 3 years ago

looks good to me @kmcrawford it could be worth updating the readme with new functionality as well

matteofigus commented 3 years ago

LGTM - unfortunately CI is broken because we need to migrate travis to Github actions - but happy to merge and publish if you checked all is green on your side.

kmcrawford commented 3 years ago

I have tested and looks good for me. Thanks.