Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
Fix how tslib is found
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Sep 7, 2018
1 parent ba4583c commit 23ffe89
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"dependencies": {
"compare-versions": "2.0.1",
"object-assign": "^4.0.1",
"resolve": "^1.8.1",
"rollup-pluginutils": "^1.3.1",
"tippex": "^2.1.1",
"tslib": ">=1.9.0",
Expand Down
1 change: 1 addition & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default {
'path',
'fs',
'object-assign',
'resolve',
'rollup-pluginutils',
'tippex',
'typescript'
Expand Down
7 changes: 3 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as ts from 'typescript';
import { createFilter } from 'rollup-pluginutils';
import * as path from 'path';
import * as fs from 'fs';
import assign from 'object-assign';
import compareVersions from 'compare-versions';
import resolveId from 'resolve';

import { endsWith } from './string';
import { getDefaultOptions, compilerOptionsFromTsConfig, adjustCompilerOptions } from './options.js';
Expand All @@ -19,9 +19,8 @@ interface Options {
}
*/

// The injected id for helpers. Intentially invalid to prevent helpers being included in source maps.
const helpersId = 'tslib';
const helpersSource = fs.readFileSync( path.resolve( __dirname, '../node_modules/tslib/tslib.es6.js' ), 'utf-8' );
const helpersId = '\0tslib';
const helpersSource = fs.readFileSync(resolveId.sync('tslib/tslib.es6.js', { basedir: __dirname }), 'utf-8' );

export default function typescript ( options ) {
options = assign( {}, options || {} );
Expand Down

0 comments on commit 23ffe89

Please sign in to comment.