terser / html-minifier-terser

actively maintained fork of html-minifier - minify HTML, CSS and JS code using terser - supports ES6 code
https://terser.org/html-minifier-terser
MIT License
385 stars 32 forks source link

Support <script type="importmap"> #169

Closed sdavids closed 11 months ago

sdavids commented 1 year ago

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap

<script type="importmap">
  {
    "imports": {
      "shapes/": "./module/shapes/",
      "othershapes/": "https://example.com/modules/shapes/"
    }
  }
</script>

<script type="importmap">{"imports":{"shapes/":"./module/shapes/","othershapes/":"https://example.com/modules/shapes/"}}</script>

Basically JSON.stringify(JSON.parse(scriptElement.textContent)).