Skip to content

Commit

Permalink
Merge pull request #5213 from mkslanc/esm-resolver-dts
Browse files Browse the repository at this point in the history
Generate esm-resolver.d.ts to provide intellisense
  • Loading branch information
nightwing authored Jun 26, 2023
2 parents c910951 + 4d8aaae commit ce4674a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.dryice.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ function buildTypes() {

var pathModules = [
"declare module 'ace-builds/webpack-resolver';",
"declare module 'ace-builds/esm-resolver';",
"declare module 'ace-builds/src-noconflict/ace';"
].concat(paths.map(function(path) {
if (moduleNameRegex.test(path)) {
Expand Down
3 changes: 3 additions & 0 deletions tool/esm_resolver_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ function buildResolver() {
return `ace.config.setModuleLoader('${moduleName}', () => import('./${moduleName.replace("ace", "src") + ".js"}'));`;
}).join('\n') + "\n\nexport * as default from \"./src/ace\";";

var declaration = 'export * from "./ace"';

fs.writeFileSync(__dirname + '/../esm-resolver.js', loader, "utf8");
fs.writeFileSync(__dirname + '/../esm-resolver.d.ts', declaration, "utf8");
}

function getModuleNames() {
Expand Down

0 comments on commit ce4674a

Please sign in to comment.