import type { Optimizer } from '../../@types/optimizer'; import type { CompileOptions } from '../../@types/compiler'; import path from 'path'; import { getAttrValue, setAttrValue } from '../../ast.js'; export default function ({ compileOptions, filename }: { compileOptions: CompileOptions; filename: string; fileID: string }): Optimizer { const { astroConfig } = compileOptions; const { astroRoot } = astroConfig; const fileUrl = new URL(`file://${filename}`); return { visitors: { html: { Element: { enter(node) { let name = node.name; if (name !== 'script') { return; } let type = getAttrValue(node.attributes, 'type'); if (type !== 'module') { return; } let src = getAttrValue(node.attributes, 'src'); if (!src || !src.startsWith('.')) { return; } const srcUrl = new URL(src, fileUrl); const fromAstroRoot = path.posix.relative(astroRoot.pathname, srcUrl.pathname); const absoluteUrl = `/_astro/${fromAstroRoot}`; setAttrValue(node.attributes, 'src', absoluteUrl); }, }, }, }, async finalize() {}, }; } rnal?id=12ff562d31fc5ab53c74aacb6ab2cd26444ed978'>treecommitdiff
path: root/vendor/golang.org/x/net/internal (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2018-02-04Move template functions outside engine (refactoring)Gravatar Frédéric Guillot 9-214/+254
2018-02-04Take timezone into consideration when calculating relative timeGravatar Frédéric Guillot 16-58/+91
2018-02-03Add support for HTTP Strict Transport Security headerGravatar Frédéric Guillot 4-3/+33
2018-02-03Add support for base URLs with subfoldersGravatar Frédéric Guillot 10-23/+105
2018-02-01Update German translationGravatar stratmaster 2-4/+12
2018-01-31Add missing about menu in settingsGravatar Frédéric Guillot 5-5/+29
2018-01-31Show API URL endpoints in user interfaceGravatar Frédéric Guillot 11-14/+99
2018-01-29Do not update entry date while refreshing a feedGravatar Frédéric Guillot 1-4/+5
2018-01-29Enable debug mode for integration testsGravatar Frédéric Guillot 1-1/+1
2018-01-29Add the possiblity to enable debug mode with an environment variableGravatar Frédéric Guillot 2-1/+6
2018-01-29Keep code base tidyGravatar Frédéric Guillot 5-18/+16
2018-01-29Add flag to enable debug loggingGravatar Rogier Lommers 2-7/+64
2018-01-25Improve unread counter updatesGravatar Mahendra Kalkura 1-6/+35