@thedanbob/esbuild-plugin-sass 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,8 +5,15 @@ const importer = {
|
|
|
5
5
|
findFileUrl: (url) => {
|
|
6
6
|
if (!url.startsWith("~"))
|
|
7
7
|
return null;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
try {
|
|
9
|
+
// import.meta.resolve searches for an index file by default, which isn't guaranteed to exist.
|
|
10
|
+
// Instead, we attempt to resolve <package>/package.json
|
|
11
|
+
const file = url.replace(/^~(.+?)\/.+/, "$1/package.json");
|
|
12
|
+
return new URL(url.substring(1), import.meta.resolve(file).replace(/(?<=node_modules\/).+/, ""));
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
10
17
|
}
|
|
11
18
|
};
|
|
12
19
|
export default ({ filter = /.(s[ac]ss|css)$/, quietDeps = false, silenceDeprecations = [], transform = undefined } = {}) => ({
|