ts-loader
Advanced tools
Comparing version 0.3.0 to 0.3.1
# Changelog | ||
## v0.3.1 | ||
- Add support for specifying a custom TypeScript compiler | ||
## v0.3.0 | ||
@@ -4,0 +8,0 @@ |
@@ -17,2 +17,3 @@ ///<reference path="node_modules/typescript/bin/typescript.d.ts" /> | ||
function ensureTypeScriptInstance(options) { | ||
var compiler = require(options.compiler); | ||
if (Object.prototype.hasOwnProperty.call(instances, options.instance)) | ||
@@ -63,4 +64,5 @@ return instances[options.instance]; | ||
}; | ||
var languageService = typescript.createLanguageService(servicesHost, typescript.createDocumentRegistry()); | ||
var languageService = compiler.createLanguageService(servicesHost, compiler.createDocumentRegistry()); | ||
return instances[options.instance] = { | ||
compiler: compiler, | ||
compilerOptions: compilerOptions, | ||
@@ -79,2 +81,3 @@ files: files, | ||
instance: 'default', | ||
compiler: 'typescript', | ||
sourceMap: false | ||
@@ -86,3 +89,3 @@ }, options); | ||
filePaths.push(filePath); | ||
var program = typescript.createProgram(filePaths, instance.compilerOptions, typescript.createCompilerHost(instance.compilerOptions)); | ||
var program = instance.compiler.createProgram(filePaths, instance.compilerOptions, instance.compiler.createCompilerHost(instance.compilerOptions)); | ||
program.getSourceFiles().forEach(function (file) { | ||
@@ -89,0 +92,0 @@ var filePath = path.normalize(file.filename); |
{ | ||
"name": "ts-loader", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "TypeScript loader for webpack", | ||
@@ -36,2 +36,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"jsx-typescript": "^1.5.0-alpha.4", | ||
"mocha": "^2.1.0", | ||
@@ -38,0 +39,0 @@ "webpack": "^1.5.3" |
@@ -54,2 +54,7 @@ # TypeScript loader for webpack | ||
##### compiler *(string) (default='typescript')* | ||
Allows use of TypeScript compilers other than the official one. Should be | ||
set to the NPM name of the compiler. | ||
##### instance *(string)* | ||
@@ -105,4 +110,8 @@ | ||
Please see [ts-jsx-loader](https://github.com/jbrantly/ts-jsx-loader) | ||
This loader supports using [jsx-typescript](https://github.com/fdecampredon/jsx-typescript). | ||
Simply install jsx-typescript and use the `compiler=jsx-typescript` option. | ||
If for some reason using `jsx-typescript` doesn't work or you want to use the official | ||
TypeScript take a look at [ts-jsx-loader](https://github.com/jbrantly/ts-jsx-loader). | ||
## Building from source | ||
@@ -109,0 +118,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12205
121
147
3
2