web-components-loader
web-components-loader copied to clipboard
Allow inline `<script>` code to be transformed too
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.
- When parsing an HTML file, grab each
<script>
element without asrc
attribute. - Call
this.options.webComponentsLoader.transformJs
(if available), passing the stringified contents of the<script>
. - Replace contents of
<script>
with output returned fromtransformJs
when writing HTML file to output location.