Question : npm module-alias
Answered by : hustle-everyday
// Step 1: Install
npm i --save module-alias
// Step 2: Create the aliases in "package.json"
"_moduleAliases": { "@root" : ".", // Application's root "@deep" : "src/some/very/deep/directory/or/file", "@my_module" : "lib/some-file.js", "something" : "src/foo", // Or without @. Actually, it could be any string
}
// Step 3: Then add this line at the very top of the main file of your app...
// ... before any code.
require('module-alias/register')
Source : | Last Update : Fri, 12 Aug 22
Question : npm module-alias
Answered by : anxious-ape-kh7vobel7mnf
module-alias
Source : | Last Update : Mon, 16 Aug 21