UNPKG

webpack-resolve-short-path-plugin

Version:

A plugin for enhanced-resolve (Webpack v2) that resolves paths like ~module to %rootPath%/module so you don't have to write relative paths like ../../../module.

14 lines (10 loc) 260 B
module.exports = function(path) { //make sure the request starts with `~` followed by a character that is not a directory separator if (!path || path.length < 2 || path[0] !== '~' || path[1] === '/' ) { return false; } return true; };