-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: respect third-party plugins for
Less
(#353)
- Loading branch information
1 parent
73740a8
commit d0db4f9
Showing
7 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.file-loader { | ||
background: coral; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@import "forFileLoaderPluginResolve.less"; | ||
@import (once) url("https://fonts.googleapis.com/css?family=Roboto:500"); | ||
@import "~@scope/module"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import path from "path"; | ||
import less from "less"; | ||
|
||
class Plugin extends less.FileManager { | ||
supports(filename) { | ||
if (filename === 'forFileLoaderPluginResolve.less') { | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
loadFile(filename, ...args) { | ||
const result = path.resolve(__dirname, '../', 'file-load-replacement.less'); | ||
|
||
return super.loadFile(result, ...args); | ||
}; | ||
} | ||
|
||
class CustomFileLoaderPlugin { | ||
install(less, pluginManager) { | ||
pluginManager.addFileManager(new Plugin()); | ||
} | ||
} | ||
|
||
module.exports = CustomFileLoaderPlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters