Skip to content

Commit

Permalink
fix dts-bundler to work with typescript 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Jan 19, 2022
1 parent 3289a41 commit 7d90149
Show file tree
Hide file tree
Showing 2 changed files with 454 additions and 50 deletions.
26 changes: 3 additions & 23 deletions scripts/dts-localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const run = async (entrySourceFiles: string[], outputPath: string, option

const replacementPath = getReplacementPath(currentSourceFile, referencedSourceFile, target);
// @ts-ignore
node.moduleSpecifier = ts.factory.createStringLiteral(replacementPath);
node.moduleSpecifier = ts.createStringLiteral(replacementPath);

return true;
}
Expand Down Expand Up @@ -210,7 +210,8 @@ export const run = async (entrySourceFiles: string[], outputPath: string, option
const replacementPath = getReplacementPath(currentSourceFile, referencedSourceFile, target);

// @ts-ignore
node.argument = ts.factory.createStringLiteral(replacementPath);
node.argument = ts.createStringLiteral(replacementPath);
// node.argument = ts.factory.createStringLiteral(replacementPath); // TS4

return true;
}
Expand Down Expand Up @@ -258,24 +259,3 @@ export const run = async (entrySourceFiles: string[], outputPath: string, option
}
}
};

// run(
// [getAbsolutePath('./dist/ts-tmp/index.d.ts')],
// path.join(__dirname, '..', 'dist', 'ts3.9'),

// {
// externals: [
// '@storybook/addons',
// '@storybook/csf',
// '@storybook/theming',
// 'core-js',
// 'react-dom',
// 'prop-types',
// 'react',
// ],
// }
// ).catch((e) => {
// console.error(e);

// process.exit(1);
// });
Loading

0 comments on commit 7d90149

Please sign in to comment.