Skip to content

Commit

Permalink
test: ambiguous imports (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Jun 22, 2020
1 parent 73009fd commit c11478d
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 162,964 deletions.
11 changes: 7 additions & 4 deletions src/getPossibleRequests.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import { urlToRequest } from 'loader-utils';
const isModuleImport = /^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/;

/**
* When libsass tries to resolve an import, it uses a special algorithm.
* Since the sass-loader uses webpack to resolve the modules, we need to simulate that algorithm. This function
* returns an array of import paths to try. The last entry in the array is always the original url
* to enable straight-forward webpack.config aliases.
* When `sass`/`node-sass` tries to resolve an import, it uses a special algorithm.
* Since the `sass-loader` uses webpack to resolve the modules, we need to simulate that algorithm.
* This function returns an array of import paths to try.
* The last entry in the array is always the original url to enable straight-forward webpack.config aliases.
*
* We don't need emulate `dart-sass` "It's not clear which file to import." errors (when "file.ext" and "_file.ext" files are present simultaneously in the same directory).
* This reduces performance and `dart-sass` always do it on own side.
*
* @param {string} url
* @param {boolean} forWebpackResolver
Expand Down
Loading

0 comments on commit c11478d

Please sign in to comment.