Skip to content

Commit

Permalink
fix: remove exported importer function
Browse files Browse the repository at this point in the history
As discussed in code review, this is more the responsibility of the
consumer, as `sass-loader/dist/utils.js` already exports all the
necessary functionality.
  • Loading branch information
vvanpo committed Aug 5, 2020
1 parent 534869c commit 18bb883
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 213 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -77,7 +77,6 @@
"css-loader": "^4.2.0",
"del": "^5.1.0",
"del-cli": "^3.0.1",
"enhanced-resolve": "^4.3.0",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.21.2",
Expand Down
73 changes: 0 additions & 73 deletions src/importer.js

This file was deleted.

15 changes: 15 additions & 0 deletions src/utils.js
Expand Up @@ -273,6 +273,21 @@ const isSpecialModuleImport = /^~[^/]+$/;
// `[drive_letter]:\` + `\\[server]\[sharename]\`
const isNativeWin32Path = /^[a-zA-Z]:[/\\]|^\\\\/i;

/**
* Create the resolve function used in the custom Sass importer.
*
* @param {Object} implementation - The imported Sass implementation, both
* `sass` (Dart Sass) and `node-sass` are supported.
* @param {Function} resolverFactory - A factory function for creating a Webpack
* resolver. The resulting `resolve` function should be compatible with the
* asynchronous resolve function supplied by [`enhanced-resolve`]{@link
* https://github.com/webpack/enhanced-resolve}.
* If using this utility outside of `sass-loader` in an attempt to mimic the
* Sass importer that `sass-loader` uses, you'll likely want to pass
* `resolve.create()` from `enhanced-resolve`, or a wrapped copy of it.
* @param {string[]} [includePaths] - The list of include paths passed to Sass.
* @param {boolean} [rootContext] - The configured Webpack root context.
*/
function getWebpackResolver(
implementation,
resolverFactory,
Expand Down
95 changes: 0 additions & 95 deletions test/__snapshots__/importer.test.js.snap

This file was deleted.

44 changes: 0 additions & 44 deletions test/importer.test.js

This file was deleted.

0 comments on commit 18bb883

Please sign in to comment.