Permalink
Browse files

fix(ts): workaround for allowSyntheticDefaultImports

this makes it not mandatory anymore to setup allowSyntheticDefaultImports in your tsconfig, when using the i18n plugin

resolves #236
  • Loading branch information...
josundt authored and zewa666 committed Oct 21, 2017
1 parent 5deb4d2 commit ec6dbbe41c69fe338ddf89979d82edcae73862c4
Showing with 6 additions and 5 deletions.
  1. +2 −0 build/tasks/build.js
  2. +1 −3 dist/aurelia-i18n.d.ts
  3. +1 −0 package.json
  4. +2 −2 src/customTypings/i18next.d.ts
View
@@ -16,6 +16,7 @@ var gulpIgnore = require('gulp-ignore');
var merge = require('merge2');
var jsName = paths.packageName + '.js';
var compileToModules = ['es2015', 'commonjs', 'amd', 'system', 'native-modules'];
var replace = require("gulp-replace");
function cleanGeneratedCode() {
return through2.obj(function(file, enc, callback) {
@@ -64,6 +65,7 @@ gulp.task('build-index', function() {
gulp.task('build-es2015-temp', function () {
return gulp.src(paths.output + jsName)
.pipe(replace('import i18next from', 'import * as i18next from')) // Replace babel cjs import syntax with TS cjs import syntax
.pipe(to5(assign({}, compilerOptions.commonjs())))
.pipe(gulp.dest(paths.output + 'temp'));
});
View
@@ -1,5 +1,5 @@
import * as LogManager from 'aurelia-logging';
import i18next from 'i18next';
import * as i18next from 'i18next';
import {
resolver
} from 'aurelia-dependency-injection';
@@ -85,8 +85,6 @@ export declare class Backend {
readMulti(languages?: any, namespaces?: any, callback?: any): any;
read(language?: any, namespace?: any, callback?: any): any;
loadUrl(url?: any, callback?: any): any;
/* no retry */
create(languages?: any, namespace?: any, key?: any, fallbackValue?: any): any;
}
export declare class BaseI18N {
View
@@ -102,6 +102,7 @@
"gulp-ignore": "^2.0.1",
"gulp-insert": "^0.5.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.6.1",
"gulp-typedoc": "^2.0.0",
"gulp-typedoc-extractor": "0.0.8",
"gulp-typescript": "^2.13.6",
@@ -121,5 +121,5 @@ declare namespace I18next {
declare module 'i18next' {
var i18next:I18next.I18n;
export default i18next;
}
export = i18next;
}

1 comment on commit ec6dbbe

@gerbendekker

This comment has been minimized.

Show comment
Hide comment
@gerbendekker

gerbendekker Nov 5, 2017

perfect, solves the issue I just bumped into

gerbendekker commented on ec6dbbe Nov 5, 2017

perfect, solves the issue I just bumped into

Please sign in to comment.