ts-import-plugin
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -9,2 +9,3 @@ import * as ts from 'typescript'; | ||
styleExt?: string; | ||
transformToDefaultImport?: boolean; | ||
} | ||
@@ -11,0 +12,0 @@ export interface ImportedStruct { |
@@ -55,5 +55,7 @@ "use strict"; | ||
_importName; | ||
var scriptNode = ts.createImportDeclaration(undefined, undefined, ts.createImportClause(!struct.variableName ? ts.createIdentifier(struct.importName) : undefined, struct.variableName ? ts.createNamedImports([ | ||
ts.createImportSpecifier(ts.createIdentifier('default'), ts.createIdentifier(struct.variableName)) | ||
]) : undefined), ts.createLiteral(libraryName + "/" + (options.libraryDirectory ? options.libraryDirectory + '/' : '') + importName)); | ||
var scriptNode = ts.createImportDeclaration(undefined, undefined, ts.createImportClause(struct.variableName || !options.transformToDefaultImport ? undefined : ts.createIdentifier(struct.importName), struct.variableName ? ts.createNamedImports([ | ||
ts.createImportSpecifier(options.transformToDefaultImport ? ts.createIdentifier('default') : ts.createIdentifier(struct.importName), ts.createIdentifier(struct.variableName)) | ||
]) : options.transformToDefaultImport ? undefined : ts.createNamedImports([ | ||
ts.createImportSpecifier(undefined, ts.createIdentifier(struct.importName)) | ||
])), ts.createLiteral(libraryName + "/" + (options.libraryDirectory ? options.libraryDirectory + '/' : '') + importName)); | ||
astNodes.push(scriptNode); | ||
@@ -71,3 +73,4 @@ if (options.style) { | ||
style: false, | ||
camel2DashComponentName: true | ||
camel2DashComponentName: true, | ||
transformToDefaultImport: true | ||
}; | ||
@@ -74,0 +77,0 @@ function createTransformer(_options) { |
{ | ||
"name": "ts-import-plugin", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "babel-plugin-import TypeScript version", | ||
@@ -38,16 +38,17 @@ "main": "index.js", | ||
"@types/react": "^16.0.0", | ||
"@types/react-dom": "^15.5.1", | ||
"@types/react-dom": "^16.0.0", | ||
"antd": "^2.12.3", | ||
"chai": "^4.1.0", | ||
"coveralls": "^2.13.1", | ||
"coveralls": "^3.0.0", | ||
"css-loader": "^0.28.4", | ||
"extract-text-webpack-plugin": "^3.0.0", | ||
"lodash": "^4.17.4", | ||
"mocha": "^3.5.0", | ||
"mocha": "^4.0.0", | ||
"nyc": "^11.1.0", | ||
"react": "^15.6.1", | ||
"react-dom": "^15.6.1", | ||
"react": "^16.0.0", | ||
"react-dom": "^16.0.0", | ||
"rxjs": "^5.5.0", | ||
"standard": "^10.0.2", | ||
"style-loader": "^0.18.2", | ||
"ts-loader": "^2.3.2", | ||
"style-loader": "^0.19.0", | ||
"ts-loader": "^3.0.2", | ||
"ts-node": "^3.3.0", | ||
@@ -54,0 +55,0 @@ "tslint": "^5.5.0", |
Sorry, the diff of this file is not supported yet
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
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
14614
125
26