How to use the @lwc/errors.ModuleResolutionErrors.NONEXISTENT_FILE function in @lwc/errors

To help you get started, we’ve selected a few @lwc/errors examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github salesforce / lwc / packages / @lwc / compiler / src / rollup-plugins / module-resolver.ts View on Github external
function readFile(filename: string, options: NormalizedCompileOptions): string {
    const { files } = options;

    if (fileExists(filename, options)) {
        return files[filename];
    } else {
        throw generateCompilerError(ModuleResolutionErrors.NONEXISTENT_FILE, {
            messageArgs: [filename],
            origin: { filename },
        });
    }
}
github salesforce / lwc / packages / @lwc / compiler / src / rollup-plugins / module-resolver.ts View on Github external
function readFile(filename: string, options: NormalizedCompilerOptions): string {
    const { files } = options;

    if (fileExists(filename, options)) {
        return files[filename];
    } else {
        throw generateCompilerError(ModuleResolutionErrors.NONEXISTENT_FILE, {
            messageArgs: [filename],
            origin: { filename },
        });
    }
}