File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import { convertLessError, getLessImports } from './less-utils';
77export interface LoaderOptions {
88 /* Custom filter */
99 filter ?: RegExp ;
10+ /* Support importing less as string in typescript */
11+ inline ?: boolean ;
1012}
1113
1214/**
@@ -40,7 +42,9 @@ export function lessLoader(lessOptions: Less.Options = {}, loaderOptions: Loader
4042 const dir = path . dirname ( args . path ) ;
4143 const basename = path . basename ( args . path ) ;
4244 const isModule = basename . endsWith ( '.module.less' ) ;
43- const loader : Loader = isModule ? 'local-css' : 'css' ;
45+ const loader : Loader = loaderOptions . inline === true
46+ ? 'text'
47+ : ( isModule ? 'local-css' : 'css' ) ;
4448
4549 const opts : Less . Options & { relativeUrls : boolean } = {
4650 filename : args . path ,
You can’t perform that action at this time.
0 commit comments