Skip to content
This repository has been archived by the owner on Apr 4, 2020. It is now read-only.

Commit

Permalink
feat(options): Add selector property to schema
Browse files Browse the repository at this point in the history
This lets users reference their own string selector inside the
insertInto function. Necessary until webpack-contrib#328 is resolved.
  • Loading branch information
bcanseco committed Jul 30, 2018
1 parent fc24512 commit 558665f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions options.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
{ "instanceof": "Function" }
]
},
"selector": {
"type": "string"
},
"transform": {
"type": "string"
},
Expand Down

1 comment on commit 558665f

@bcanseco
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
  loader: 'style-loader',
  options: {
    selector: `div[${componentName}]`, // custom field from our style-loader fork
    insertInto: () => {
      /* eslint-disable-next-line no-undef */
      return document.querySelector(options.selector).shadowRoot;
    },
  },
},

Please # to comment.