當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript grunt.initConfig函數代碼示例

本文整理匯總了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: ''
			})
		);
開發者ID:dylans,項目名稱:grunt-dojo2,代碼行數:30,代碼來源:link.ts

示例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();
開發者ID:dylans,項目名稱:grunt-dojo2,代碼行數:31,代碼來源:typedoc.ts

示例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'
							}
開發者ID:dylans,項目名稱:grunt-dojo2,代碼行數:31,代碼來源:repl.ts

示例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": "",
開發者ID:dylans,項目名稱:grunt-dojo2,代碼行數:31,代碼來源:fixSourceMaps.ts

示例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();
		},
開發者ID:dylans,項目名稱:grunt-dojo2,代碼行數:32,代碼來源:rename.ts

示例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();
	},
開發者ID:dylans,項目名稱:grunt-dojo2,代碼行數:30,代碼來源:ts.ts


注:本文中的grunt.initConfig函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。