
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@gamecreator/tscompile
Advanced tools
处理ts源文件排序问题。
npm i @gamecreator/tscompile
安装
npm i @gamecreator/tscompile
使用
// const { compile } = require('./');
const { compile } = require('@gamecreator/tscompile');
const tsconfig = `
{
"compilerOptions": {
"sourceMap": true,
"declaration": true,
"declarationMap": true,
"outFile": "dist/index.js"
},
"files": [
"src/index.ts",
"src/AA.ts",
"src/A.ts"
]
}
`;
const files = {
'src/index.ts': `const aa = new AA();console.log(aa);`,
'src/AA.ts': `class AA extends A{
aa = 1;
}`,
'src/A.ts': `class A {
a = 1;
}`
};
const result = tscompile.compile(tsconfig, files);
console.log(`输出结果`, result);
console.log(`输出文件`, result.outputs);
console.log(`源码排序结果`, result.sortedFileNames);
https://unpkg.com/@gamecreator/tscompile@0.0.4/index.html
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/typescript@4.4.4/lib/typescriptServices.js"></script>
<script src="https://unpkg.com/@gamecreator/tscompile@0.0.4/dist/index.js"></script>
</head>
<body>
<script>
const tsconfig = `
{
"compilerOptions": {
"sourceMap": true,
"declaration": true,
"declarationMap": true,
"outFile": "dist/index.js"
},
"files": [
"src/index.ts",
"src/AA.ts",
"src/A.ts"
]
}
`;
const files = {
'src/index.ts': `const aa = new AA();console.log(aa);`,
'src/AA.ts': `class AA extends A{
aa = 1;
}`,
'src/A.ts': `class A {
a = 1;
}`
};
const result = tscompile.compile(tsconfig, files);
console.log(`输出结果`, result);
console.log(`输出文件`, result.outputs);
console.log(`源码排序结果`, result.sortedFileNames);
</script>
</body>
</html>
FAQs
处理ts源文件排序问题。
We found that @gamecreator/tscompile 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.