@ms-cloudpack/bundler-plugin-ori
Advanced tools
Comparing version 0.12.1 to 0.12.2
import type { BundleOptions } from '@ms-cloudpack/bundler-types'; | ||
import type { BuildOptions as OriBuildOptions } from 'oribuild'; | ||
/** | ||
* The intended use of `absWorkingDir` in esbuild is to resolve relative paths from options. | ||
* However, ori also uses `absWorkingDir` as the virtual FS root for module resolution in plugins. | ||
* This means if `inputPath` is an individual package in a monorepo, ori won't be able to resolve | ||
* scss `@import`s from other packages (which are often in `node_modules` at the git root). | ||
* As a workaround, we use the git root (if available) as `absWorkingDir` and adjust all other paths. | ||
* https://github.com/microsoft/cloudpack/issues/1174 | ||
*/ | ||
export declare function getAbsWorkingDir(inputPath: string): string; | ||
export declare function getOriOptions(options: BundleOptions): OriBuildOptions; | ||
//# sourceMappingURL=getOriOptions.d.ts.map |
@@ -62,3 +62,3 @@ import { builtinModules } from 'module'; | ||
*/ | ||
function getAbsWorkingDir(inputPath) { | ||
export function getAbsWorkingDir(inputPath) { | ||
try { | ||
@@ -65,0 +65,0 @@ return findGitRoot(inputPath); |
import { slash } from '@ms-cloudpack/path-string-parsing'; | ||
import path from 'path'; | ||
import { getAbsWorkingDir } from './getOriOptions.js'; | ||
export function normalizeOutput(params) { | ||
@@ -57,3 +58,3 @@ const { options, input, output } = params; | ||
location: { | ||
file: slash(path.resolve(inputPath, location.file)), | ||
file: slash(path.resolve(getAbsWorkingDir(inputPath), location.file)), | ||
line: location.line, | ||
@@ -60,0 +61,0 @@ column: location.column, |
{ | ||
"name": "@ms-cloudpack/bundler-plugin-ori", | ||
"version": "0.12.1", | ||
"version": "0.12.2", | ||
"description": "An abstraction to bundle source code using ori.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26883
265