Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
typescript-cp
Advanced tools
Copy non-typescript files to outDir
$ npm install typescript-cp -D
# Copy
$ tscp
# Copy for TS project references
$ tscp -b
# Watcher
$ tscp -w
# Watcher for TS project references
$ tscp -b -w
# Custom compiler settings
$ tscp -p tsconfig.production.json
# Help
$ tscp -h
package.json
{
//...
"scripts": {
"start": "tsc -w & tscp -w",
"build": "tsc && tscp"
},
//...
}
.tscprc
{
"ignored_files": ['**/an_ignored_file.ext'], // files not to copy (defaults to `['node_modules']`)
"compiled_files": [], // files compiled by TS (these also get ignored) (defaults to `['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx']`)
"use_ts_exclude": true, // ignore files that are listed in the tsconfig `exclude` array (defaults to `true`)
}
You can attach basic loader rules to the files. Loaders accept the actual content of the given file as the first parameter, and must return the content of the output file.
.tscprc.js
const path = require('path');
/**
* @type {import('typescript-cp/dist/types').Config}
*/
module.exports = {
rules: [
{
test: /\.(scss|sass)$/,
include: [
path.resolve('./file-to-include.css'),
],
exclude: (source_path) => {
return source_path.indexOf('file-to-include.sass') > -1;
},
use: [
{
loader: (content, meta) => {
// Do something with `content`
return content;
},
},
],
},
],
};
See Config
and Rule
types in src/types.ts
for the complete reference.
$ npm run build
Sponsored by: SRG Group Kft.
FAQs
Copy non-typescript files to outDir
The npm package typescript-cp receives a total of 4,546 weekly downloads. As such, typescript-cp popularity was classified as popular.
We found that typescript-cp 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.