web-components-loader
web-components-loader copied to clipboard
Allow inline `<script>` code to be transformed too
trafficstars
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 asrcattribute. - Call
this.options.webComponentsLoader.transformJs(if available), passing the stringified contents of the<script>. - Replace contents of
<script>with output returned fromtransformJswhen writing HTML file to output location.