本文整理汇总了TypeScript中grunt.initConfig函数的典型用法代码示例。如果您正苦于以下问题:TypeScript initConfig函数的具体用法?TypeScript initConfig怎么用?TypeScript initConfig使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了initConfig函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getOutputDirectory
getOutputDirectory, loadTasks, unloadTasks, runGruntTask, prepareOutputDirectory,
cleanOutputDirectory
} from '../util';
const outputPath = getOutputDirectory();
const cwd = process.cwd();
let symlink: SinonStub;
let shell: SinonStub = stub();
let run: SinonStub;
registerSuite({
name: 'tasks/link',
setup() {
grunt.initConfig({
distDirectory: outputPath
});
symlink = stub(fs, 'symlink');
shell.withArgs(
'npm link',
{
cwd: outputPath
}
).returns(
Promise.resolve({
stdout: ''
})
);
示例2: beforeEach
beforeEach() {
grunt.initConfig({
apiDocDirectory,
apiPubDirectory,
tsconfig: {
compilerOptions: {
inlineSourceMap: true,
inlineSources: true,
listFiles: true,
module: 'commonjs',
noImplicitAny: true,
pretty: true,
target: 'es5'
}
},
typedoc: {
options: {
mode: 'modules',
excludeExternals: true,
excludeNotExported: true,
tsconfig: tsconfigPath,
logger: 'none',
publishOptions: {
subDirectory: 'api',
publishMode: publishModeStub
}
}
}
});
write.reset();
示例3: require
import * as registerSuite from 'intern!object';
import * as assert from 'intern/chai!assert';
import * as grunt from 'grunt';
import { loadTasks, unloadTasks, runGruntTask } from '../util';
import Test = require("intern/lib/Test");
let fakeRepl: any = {};
const fakeDojoRequire = function () {
};
registerSuite({
name: 'tasks/repl',
setup() {
grunt.initConfig({});
loadTasks({
repl: {
start() {
return {
context: fakeRepl
};
}
},
'../lib/load-dojo-loader': {
default() {
return {
baseUrl: './base-url',
packages: [
{
name: 'package-1'
}
示例4: getInputDirectory
import * as registerSuite from 'intern!object';
import * as assert from 'intern/chai!assert';
import * as grunt from 'grunt';
import {
getInputDirectory, loadTasks, prepareInputDirectory, unloadTasks, cleanInputDirectory,
createDummyFile, runGruntTask, fileExistsInInputDirectory
} from '../util';
const inputDirectory = getInputDirectory();
registerSuite({
name: 'tasks/fixSourceMaps',
setup() {
grunt.initConfig({
distDirectory: inputDirectory
});
loadTasks();
prepareInputDirectory();
},
teardown() {
unloadTasks();
cleanInputDirectory();
},
sourcMaps() {
createDummyFile('test/sourcemap.js.map', JSON.stringify(
{
"version": 3,
"file": "global.js",
"sourceRoot": "",
示例5: getInputDirectory
createDummyDirectory,
fileExistsInInputDirectory,
fileExistsInOutputDirectory, cleanInputDirectory, cleanOutputDirectory
} from '../util';
const inputDirectory = getInputDirectory();
const outputPath = getOutputDirectory();
registerSuite({
name: 'tasks/rename',
setup() {
grunt.initConfig({
rename: {
textFiles: {
expand: true,
cwd: inputDirectory,
src: ['**/*.txt'],
dest: outputPath
}
}
});
loadTasks();
},
teardown() {
unloadTasks();
},
basic: {
beforeEach() {
prepareInputDirectory();
prepareOutputDirectory();
},
示例6: unloadTasks
unloadTasks();
cleanOutputDirectory();
},
beforeEach() {
grunt.initConfig({
distDirectory: outputPath,
tsconfig: {
"compilerOptions": {
"inlineSourceMap": true,
"inlineSources": true,
"listFiles": true,
"module": "commonjs",
"noImplicitAny": true,
"pretty": true,
"target": "es6"
}
},
ts: {
custom: {
compilerOptions: {
target: 'custom'
}
}
}
});
run.reset();
write.reset();
},