docs(plunker): use the FrankWallis TS plugin (thx Filipe!)

This commit is contained in:
Ward Bell 2016-05-15 14:49:09 -07:00
parent aa65f0cf44
commit e9dd6334e4
2 changed files with 18 additions and 7 deletions

View File

@ -55,11 +55,15 @@
var config = {
// DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER
transpiler: 'typescript',
transpiler: 'ts',
typescriptOptions: {
emitDecoratorMetadata: true
tsconfig: true
},
meta: {
'typescript': {
"exports": "ts"
}
},
map: map,
packages: packages
}

View File

@ -10,7 +10,9 @@ var mkdirp = require('mkdirp');
var indexHtmlTranslator = require('./indexHtmlTranslator');
var regionExtractor = require('../doc-shredder/regionExtractor');
var COPYRIGHT, COPYRIGHT_JS, COPYRIGHT_HTML;
var SYSTEM_JS_CONFIG; // content of systemjs.config.js for plunkers that use systemjs
var SYSTEMJS_CONFIG; // content of systemjs.config.js for plunkers that use systemjs
var TSCONFIG; // content of tsconfig.json for plunkers that use systemjs
module.exports = {
buildPlunkers: buildPlunkers
@ -82,18 +84,23 @@ function buildPlunkerFrom(configFileName, basePath, destPath ) {
}
}
/**
* Add plunker versions of systemjs.config and tsconfig.json
*/
function addSystemJsConfig(config, postData){
if (config.basePath.indexOf('/ts') > -1) {
// uses systemjs.config.js so add plunker version
var relativeFileName = 'systemjs.config.js';
postData['files[' + relativeFileName + ']'] = SYSTEM_JS_CONFIG;
postData['files[' + relativeFileName + ']'] = SYSTEMJS_CONFIG;
postData['files[tsconfig.json]'] = TSCONFIG;
}
}
function getSystemJsConfigPlunker(basePath) {
// Assume plunker version is sibling of node_modules version
SYSTEM_JS_CONFIG = fs.readFileSync(basePath + '/systemjs.config.plunker.js', 'utf-8');
SYSTEM_JS_CONFIG += COPYRIGHT_JS_CSS;
SYSTEMJS_CONFIG = fs.readFileSync(basePath + '/systemjs.config.plunker.js', 'utf-8');
SYSTEMJS_CONFIG += COPYRIGHT_JS_CSS;
TSCONFIG = fs.readFileSync(basePath + '/tsconfig.json', 'utf-8');
}
function initConfigAndCollectFileNames(configFileName) {