Skip to content

Commit

Permalink
Deprecate entryFileCannotBeJs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyreilly committed Oct 18, 2017
1 parent 173bd4c commit 2aaba6e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions .npmignore
@@ -1,5 +1,6 @@
*.ts
.vscode
.test
examples
test
src
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog

## v3.0.3

- [Fix allowJs @types resolution error](https://github.com/TypeStrong/ts-loader/pull/658) (#657, #655) - thanks @johnnyreilly and @roddypratt + @ldrick for providing minimal repro repos which allowed me to fix this long standing bug!

This fix resolves the issue for TypeScript 2.4+ (which is likely 95% of users). For those people stuck on 2.4 and impacted by this issue, you should be able to workaround this by setting `entryFileCannotBeJs: true` in your ts-loader options. This option should be considered deprecated as of this release. The option will likely disappear with the next major version of ts-loader which will drop support for TypeScript 2.3 and below, thus removing the need for this option.

## v3.0.0

All changes were made with this [PR](https://github.com/TypeStrong/ts-loader/pull/643) - thanks @johnnyreilly
Expand Down
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -296,9 +296,11 @@ Advanced option to force files to go through different instances of the
TypeScript compiler. Can be used to force segregation between different parts
of your code.

#### entryFileCannotBeJs *(boolean) (default=false)*
#### entryFileCannotBeJs *(boolean) (default=false) DEPRECATED*

If the `allowJs` compiler option is `true` then it's possible for your entry files to be JS. Since people have reported occasional problems with this the `entryFileCannotBeJs` setting exists to disable this functionality (if set then your entry file cannot be JS). Please note that this is rather unusual and will generally not be necessary when using `allowJs`. This option may be removed in a future version of ts-loader if it appears to be unused (likely).
If the `allowJs` compiler option is `true` then it's possible for your entry files to be JS. There is a [known issue using ts-loader with TypeScript 2.3 and below](https://github.com/TypeStrong/ts-loader/issues/655). This option exists to work around that issue if you are using ts-loader with TypeScript 2.3 or below.

This option will be removed in a future version of ts-loader.

#### appendTsSuffixTo *(RegExp[]) (default=[])*
#### appendTsxSuffixTo *(RegExp[]) (default=[])*
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ts-loader",
"version": "3.0.2",
"version": "3.0.3",
"description": "TypeScript loader for webpack",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -110,7 +110,7 @@ function getLoaderOptions(loader: Webpack) {
}

type ValidLoaderOptions = keyof LoaderOptions;
const validLoaderOptions: ValidLoaderOptions[] = ['silent', 'logLevel', 'logInfoToStdOut', 'instance', 'compiler', 'configFile', 'transpileOnly', 'ignoreDiagnostics', 'errorFormatter', 'colors', 'compilerOptions', 'appendTsSuffixTo', 'appendTsxSuffixTo', 'entryFileCannotBeJs', 'happyPackMode', 'getCustomTransformers'];
const validLoaderOptions: ValidLoaderOptions[] = ['silent', 'logLevel', 'logInfoToStdOut', 'instance', 'compiler', 'configFile', 'transpileOnly', 'ignoreDiagnostics', 'errorFormatter', 'colors', 'compilerOptions', 'appendTsSuffixTo', 'appendTsxSuffixTo', 'entryFileCannotBeJs' /* DEPRECATED */, 'happyPackMode', 'getCustomTransformers'];

/**
* Validate the supplied loader options.
Expand Down
1 change: 1 addition & 0 deletions src/interfaces.ts
Expand Up @@ -273,6 +273,7 @@ export interface LoaderOptions {
compilerOptions: typescript.CompilerOptions;
appendTsSuffixTo: RegExp[];
appendTsxSuffixTo: RegExp[];
/** DEPRECATED */
entryFileCannotBeJs: boolean;
happyPackMode: boolean;
getCustomTransformers?(): typescript.CustomTransformers | undefined;
Expand Down

0 comments on commit 2aaba6e

Please sign in to comment.