mcss-alias-loader
Advanced tools
Comparing version 0.0.1 to 0.0.2
18
index.js
@@ -5,10 +5,14 @@ var loaderUtils = require('loader-utils'); | ||
this.cacheable && this.cacheable(); | ||
const { | ||
alias | ||
} = loaderUtils.getOptions(this); | ||
const { alias } = loaderUtils.getOptions(this); | ||
// const alias | ||
return content.replace(/@(?:import|abstract)(?:\s+)(?:'|")(\w+)/g, function (_, $1) { | ||
return alias[$1] ? alias[$1] : $1; | ||
}) | ||
}; | ||
return content.replace( | ||
/@(import|abstract)(?:\s+)('|")(\w+)/g, | ||
function (partten, impt, quote, alia) { | ||
if (alias[alia]) { | ||
return `@${impt} ${quote}${alias[alia]}`; | ||
} | ||
return partten; | ||
} | ||
); | ||
}; |
{ | ||
"name": "mcss-alias-loader", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "uising webpack alias for mcss", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
859
15
0