Skip to content

Commit

Permalink
pass better contextual error info when bun exits with errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Feb 22, 2024
1 parent 1c62a4b commit bf38f2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Bundlers/Bun/bin/plugins/css-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function (options = {}) {

const compileCss = async function (filename, opts) {
const lightningcss = await import("lightningcss").catch((error) => {
exit("lightningcss-not-installed");
exit("lightningcss-not-installed", "Lightning CSS is not installed.", error);
});

const targets = await determineTargets(opts.browserslist);
Expand All @@ -66,11 +66,11 @@ const compileCss = async function (filename, opts) {

const compileSass = async function (filename, opts) {
const lightningcss = await import("lightningcss").catch((error) => {
exit("lightningcss-not-installed");
exit("lightningcss-not-installed", "Lightning CSS is not installed.", error);
});

const sass = await import("sass").catch((error) => {
exit("sass-not-installed");
exit("sass-not-installed", "Sass is not installed", error);
});

const targets = await determineTargets(opts.browserslist);
Expand Down
2 changes: 1 addition & 1 deletion src/Bundlers/Bun/bin/utils/browser-targets.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import path from "path";
*/
export default async function (browserslist) {
const lightningcss = await import("lightningcss").catch((error) => {
exit("lightningcss-not-installed");
exit("lightningcss-not-installed", "Lightning CSS is not installed.", error);
});

// If config was given, return browserlist immediately
Expand Down

0 comments on commit bf38f2d

Please sign in to comment.