methanol 0.0.22 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "methanol",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "Static site generator powered by rEFui and MDX",
5
5
  "main": "./index.js",
6
6
  "type": "module",
@@ -148,7 +148,7 @@ const rewriteInlineScripts = async (html, routePath) => {
148
148
  await writeFile(fsPath, content)
149
149
  const publicPath = `/.methanol/inline/${filename}`
150
150
  const srcAttr = `src="${joinBasePrefix(basePrefix, publicPath)}"`
151
- const replacement = `<script type="module" ${srcAttr}></script>`
151
+ const replacement = `<script type="module" crossorigin ${srcAttr}></script>`
152
152
  patches.push({ start: entry.start, end: entry.end, text: replacement })
153
153
  }
154
154
 
@@ -382,6 +382,9 @@ export const rewriteHtmlByPlan = (
382
382
  const publicPath = resolved?.resolvedPath
383
383
  if (!publicPath) continue
384
384
  const attrs = { ...(entry.attrs || {}) }
385
+ if (!attrs.crossorigin) {
386
+ attrs.crossorigin = ''
387
+ }
385
388
  if (commonScripts.has(publicPath)) {
386
389
  if (!commonEntry?.file) {
387
390
  continue