Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
gulp-ts-alias-plus
Advanced tools
Use Gulp to resolve Typescript path aliases during compilation.
Forked of gulp-ts-alias
Support multiple imports on the same line.
npm i -D gulp-ts-alias-plus
# yarn add -D gulp-ts-alias-plus
const typescript = require('gulp-typescript');
const sourcemaps = require('gulp-sourcemaps');
const alias = require('gulp-ts-alias');
const project = typescript.createProject('tsconfig.json');
function build() {
const compiled = src('./src/**/*.ts')
.pipe(alias({ configuration: project.config }))
.pipe(sourcemaps.init())
.pipe(project());
return compiled.js
.pipe(sourcemaps.write({ sourceRoot: file => path.relative(path.join(file.cwd, file.path), file.base) }))
.pipe(dest('build/'))
}
The following configuration is common in tsconfig
configuration files
{
"rootDir": "./src",
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
}
}
In practice, these path aliases are often used in this fashion
Input:
import express from 'express';
import A from './file'; // Normal relative import
// Aliased import, resolves to some relative path to rootDir
import B from '@/components';
Output:
import express from 'express';
import A from './file';
// gulp-ts-alias finds the correct relative path
// and replaces it before compilation
import B from '../../components';
[1.1.0] - 2019-08-23
FAQs
Use Gulp to resolve Typescript path aliases during compilation.
The npm package gulp-ts-alias-plus receives a total of 2 weekly downloads. As such, gulp-ts-alias-plus popularity was classified as not popular.
We found that gulp-ts-alias-plus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.