You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-2
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,8 @@ export default {
29
29
30
30
The plugin inherits all compiler options and file lists from your `tsconfig.json` file. If your tsconfig has another name or another relative path from the root directory, see `tsconfigDefaults`, `tsconfig` and `tsconfigOverride` options below. This also allows for passing in different tsconfig files depending on your build target.
31
31
32
-
The following compiler options are forced though:
32
+
#### Some compiler options are forced
33
33
34
-
*`module`: `es2015`
35
34
*`noEmitHelpers`: false
36
35
*`importHelpers`: true
37
36
*`noResolve`: false
@@ -40,6 +39,10 @@ The following compiler options are forced though:
40
39
*`declarationDir`: `process.cwd()` (*only if `useTsconfigDeclarationDir` is false in the plugin options*)
41
40
*`moduleResolution`: `node` (*`classic` is [depreciated](https://www.typescriptlang.org/docs/handbook/module-resolution.html). It also breaks this plugin, see [#12](https://github.com/ezolenko/rollup-plugin-typescript2/issues/12) and [#14](https://github.com/ezolenko/rollup-plugin-typescript2/issues/14)*)
42
41
42
+
#### Some compiler options have more than one compatible value.
43
+
44
+
*`module`: defaults to `ES2015`, other valid value is `ESNext` (required for dynamic imports, see [#54](https://github.com/ezolenko/rollup-plugin-typescript2/issues/54)).
* - `replacer` optional function that replaces values before hashing
18476
+
* - `respectFunctionProperties` {*true|false} consider function properties when hashing
18477
+
* - `respectFunctionNames` {*true|false} consider 'name' property of functions for hashing
18478
+
* - `respectType` {*true|false} Respect special properties (prototype, constructor)
18479
+
* when hashing to distinguish between types
18480
+
* - `unorderedArrays` {true|*false} Sort all arrays before hashing
18481
+
* - `unorderedSets` {*true|false} Sort `Set` and `Map` instances before hashing
18482
+
* * = default
18483
+
*
18484
+
* @param {object} object value to hash
18485
+
* @param {object} options hashing options
18486
+
* @return {string} hash value
18487
+
* @api public
18488
+
*/
18478
18489
exports = module.exports = objectHash;
18479
18490
18480
18491
function objectHash(object, options){
@@ -18886,7 +18897,6 @@ function PassThrough() {
18886
18897
};
18887
18898
}
18888
18899
});
18889
-
18890
18900
var objectHash_2 = objectHash_1.sha1;
18891
18901
var objectHash_3 = objectHash_1.keys;
18892
18902
var objectHash_4 = objectHash_1.MD5;
@@ -19504,7 +19514,6 @@ var safe = createCommonjsModule(function (module) {
19504
19514
19505
19515
module['exports'] = colors_1;
19506
19516
});
19507
-
19508
19517
var safe_1 = safe.green;
19509
19518
var safe_2 = safe.white;
19510
19519
var safe_3 = safe.red;
@@ -19731,7 +19740,6 @@ function printDiagnostics(context, diagnostics, pretty) {
19731
19740
function getOptionsOverrides(_a, tsConfigJson) {
19732
19741
var useTsconfigDeclarationDir = _a.useTsconfigDeclarationDir;
19733
19742
var overrides = {
19734
-
module: tsModule.ModuleKind.ES2015,
19735
19743
noEmitHelpers: false,
19736
19744
importHelpers: true,
19737
19745
noResolve: false,
@@ -19747,6 +19755,27 @@ function getOptionsOverrides(_a, tsConfigJson) {
19747
19755
return overrides;
19748
19756
}
19749
19757
19758
+
function checkTsConfig(parsedConfig) {
19759
+
var module = parsedConfig.options.module;
19760
+
switch (module) {
19761
+
case tsModule.ModuleKind.ES2015:
19762
+
case tsModule.ModuleKind.ESNext:
19763
+
break;
19764
+
case undefined:
19765
+
throw new Error("Incompatible tsconfig option. Missing module option. This is incompatible with rollup, please use 'module: \"ES2015\"' or 'module: \"ESNext\"'.");
19766
+
default:
19767
+
throw new Error("Incompatible tsconfig option. Module resolves to '" + tsModule.ModuleKind[module] + "'. This is incompatible with rollup, please use 'module: \"ES2015\"' or 'module: \"ESNext\"'.");
19768
+
}
19769
+
}
19770
+
19771
+
function getOptionsDefaults() {
19772
+
return {
19773
+
compilerOptions: {
19774
+
module: "ES2015",
19775
+
},
19776
+
};
19777
+
}
19778
+
19750
19779
function parseTsConfig(context, pluginOptions) {
19751
19780
var fileName = tsModule.findConfigFile(process.cwd(), tsModule.sys.fileExists, pluginOptions.tsconfig);
19752
19781
// if the value was provided, but no file, fail hard
@@ -19769,9 +19798,10 @@ function parseTsConfig(context, pluginOptions) {
0 commit comments