Rocky_Mountain_Vending/.pnpm-store/v10/files/64/1ab80523a2932c64623ef8b773b17609fcc38f64105de5ce58356dfa862508739426313bb4e9c1b1aba0773a201d9f39530ebdfa16c67418d0a6f3c4c2efe1
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

77 lines
No EOL
3.6 KiB
Text

/*
The MIT License (MIT)
Copyright (c) 2016 Ben Holloway
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/ import path from 'path';
import { prepend, remove } from './file-protocol';
const ORPHAN_CR_REGEX = /\r(?!\n)(.|\n)?/g;
export default function process(postcss, sourceFile, sourceContent, params) {
// #107 libsass emits orphan CR not considered newline, postcss does consider newline (content vs source-map mismatch)
postcssPlugin.postcss = true;
// prepend file protocol to all sources to avoid problems with source map
return postcss([
postcssPlugin
]).process(sourceContent, {
from: prepend(sourceFile),
map: params.outputSourceMap && {
prev: !!params.inputSourceMap && prepend(params.inputSourceMap),
inline: false,
annotation: false,
sourcesContent: true
}
}).then((result)=>({
content: result.css,
map: params.outputSourceMap ? remove(result.map.toJSON()) : null
}));
/**
* Plugin for postcss that follows SASS transpilation.
*/ function postcssPlugin() {
return {
postcssPlugin: 'postcss-resolve-url',
Once: function(root) {
root.walkDecls(eachDeclaration);
}
};
/**
* Process a declaration from the syntax tree.
* @param declaration
*/ function eachDeclaration(declaration) {
const isValid = declaration.value && declaration.value.indexOf('url') >= 0;
if (isValid) {
// reverse the original source-map to find the original source file before transpilation
const startPosApparent = declaration.source.start, startPosOriginal = params.sourceMapConsumer && params.sourceMapConsumer.originalPositionFor(startPosApparent);
// we require a valid directory for the specified file
const directory = startPosOriginal && startPosOriginal.source && remove(path.dirname(startPosOriginal.source));
if (directory) {
declaration.value = params.transformDeclaration(declaration.value, directory);
} else if (params.sourceMapConsumer) {
throw Object.defineProperty(new Error('source-map information is not available at url() declaration ' + (ORPHAN_CR_REGEX.test(sourceContent) ? '(found orphan CR, try removeCR option)' : '(no orphan CR found)')), "__NEXT_ERROR_CODE", {
value: "E34",
enumerable: false,
configurable: true
});
}
}
}
}
}
//# sourceMappingURL=postcss.js.map