web-components-loader icon indicating copy to clipboard operation
web-components-loader copied to clipboard

Allow inline `<script>` code to be transformed too

Open rnicholus opened this issue 8 years ago • 0 comments

Building upon #2, which added the ability to transform WC JS files. This will take that one step further and allow <script> content inside of WC HTML files to be transformed as well.

  1. When parsing an HTML file, grab each <script> element without a src attribute.
  2. Call this.options.webComponentsLoader.transformJs (if available), passing the stringified contents of the <script>.
  3. Replace contents of <script> with output returned from transformJs when writing HTML file to output location.

rnicholus avatar Dec 04 '16 16:12 rnicholus