/** * A set of common path utilities commonly used through the Astro core and integration * projects. These do things like ensure a forward slash prepends paths. */ export function appendExtension(path: string, extension: string) { return path + '.' + extension; } export function appendForwardSlash(path: string) { return path.endsWith('/') ? path : path + '/'; } export function prependForwardSlash(path: string) { return path[0] === '/' ? path : '/' + path; } export function collapseDuplicateSlashes(path: string) { return path.replace(/(? { if (i === 0) { return removeTrailingForwardSlash(path); } else if (i === paths.length - 1) { return removeLeadingForwardSlash(path); } else { return trimSlashes(path); } }) .join('/'); } export function removeFileExtension(path: string) { let idx = path.lastIndexOf('.'); return idx === -1 ? path : path.slice(0, idx); } export function removeQueryString(path: string) { const index = path.lastIndexOf('?'); return index > 0 ? path.substring(0, index) : path; } export function isRemotePath(src: string) { return /^(?:http|ftp|https|ws):?\/\//.test(src) || src.startsWith('data:'); } export function slash(path: string) { return path.replace(/\\/g, '/'); } export function fileExtension(path: string) { const ext = path.split('.').pop(); return ext !== path ? `.${ext}` : ''; } export function removeBase(path: string, base: string) { if (path.startsWith(base)) { return path.slice(removeTrailingForwardSlash(base).length); } return path; } /option> Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/examples/with-tailwindcss/postcss.config.js (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2021-11-18Improve HMR (#1896)Gravatar Drew Powers 2-10/+18
2021-11-18update depsGravatar Fred K. Schott 5-352/+65
2021-11-18fix #1778Gravatar Fred K. Schott 2-1/+8
2021-11-18Update compiler (#1869)Gravatar Nate Moore 3-11/+6
* chore: update compiler * redeploy * fix(www): ensure www can build * chore: update compiler Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2021-11-18remove unused remark dependency (#1894)Gravatar Fred K. Schott 2-245/+13
2021-11-18Improve error messages (#1875)Gravatar Drew Powers 39-61/+448
* Fix error handling in correct scope Also improve Vite IDs for better module graph lookups * Improve code frame * Add changeset * maybeLoc can be undefined * Add tests Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2021-11-18pin astro compiler to older versionGravatar Fred K. Schott 2-5/+5
2021-11-18Update yarn.lock to reflect the state of the package.json files (#1892)Gravatar Jonathan Neal 5-1300/+1000
* update dependencies * update file to fix build:all
2021-11-19[ci] yarn formatGravatar FredKSchott 1-5/+3