本文整理汇总了TypeScript中pkg-dir.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: Promise
it('bundleable by webpack with no errors', async function() {
this.timeout(50000);
const memoryFS = new MemoryFS();
const rootPath = await pkgDir(__dirname);
const compiler = webpack({
mode: 'development',
entry: {
main: path.join(rootPath!, 'dist', 'src', 'lib', 'service.js')
},
node: {
path: 'empty', // users should provide alias to path-webpack
net: 'empty',
fs: 'empty',
module: 'empty'
}
});
compiler.outputFileSystem = memoryFS;
await new Promise((res, rej) =>
compiler.run((err, stats) => {
if (err || stats.hasErrors()) {
rej(err || new Error(stats.toString()));
} else {
res();
}
})
);
});
开发者ID:wix,项目名称:stylable-intelligence,代码行数:30,代码来源:browser-compatible.spec.ts
示例2: install
public static async install (
puppetModule : string,
puppetVersion = 'latest',
): Promise<void> {
log.info('PuppetManager', 'install(%s@%s) please wait ...', puppetModule, puppetVersion)
await npm.install(
`${puppetModule}@${puppetVersion}`,
{
cwd : await pkgDir(__dirname),
output : true,
save : false,
},
)
log.info('PuppetManager', 'install(%s@%s) done', puppetModule, puppetVersion)
}
开发者ID:zixia,项目名称:wechaty,代码行数:15,代码来源:puppet-manager.ts
示例3: run
async function run() {
const rootPath = await pkgDir()
const isInPackage = rootPath !== null
if (isInPackage) {
const scriptsPath = join(rootPath, 'node_modules', '.bin', 'tux-scripts')
const insideTuxProject = await fs.pathExists(scriptsPath)
if (insideTuxProject) {
// tslint:disable-next-line:no-console
console.log(`Inside ${chalk.cyan('tux')} project.`)
require(scriptsPath)
return
}
}
// tslint:disable-next-line:no-console
console.log(`Not inside ${chalk.cyan('tux')} project.`)
require('./new')
}
开发者ID:aranja,项目名称:tux,代码行数:20,代码来源:cli.ts
示例4: installAll
public static async installAll (): Promise<void> {
log.info('PuppetManager', 'installAll() please wait ...')
const moduleList: string[] = []
for (const puppetModuleName of Object.keys(PUPPET_DEPENDENCIES)) {
const version = PUPPET_DEPENDENCIES[puppetModuleName as any as PuppetModuleName]
if (version !== '0.0.0') {
moduleList.push(`${puppetModuleName}@${version}`)
}
}
await npm.install(
moduleList,
{
cwd : await pkgDir(__dirname),
output : true,
save : false,
},
)
}
开发者ID:zixia,项目名称:wechaty,代码行数:22,代码来源:puppet-manager.ts
示例5: suiteSetup
suiteSetup(async () => {
rootDir = await pkgDir(__dirname);
});
开发者ID:wix,项目名称:stylable-intelligence,代码行数:3,代码来源:completion.test.ts
注:本文中的pkg-dir.default函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论