google / google/closure-compiler

Preserve the export statements of specific modules

Open
#2,327 5 comments 11 reactions 1 assignee Claimed by @ChadKillingsworth View on GitHub
enhancement internal-issue-created Modules triage-done
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

Need a way to indicate specific modules which will have their export statements preserved through compilation. This will allow the compiler to both process modules and also output modules.

Supports google/closure-compiler-npm#56

I'm envisioning that module rewriting will look something like this:

```js
module$a = function() {};
module$a.foo = 'foo';

// Synthentic extern to be replaced with a module export statement
// before code printing
JSCompiler_preserveExport(module$a);
JSCompiler_preserveExport(JSCompiler_renameProperty('foo', module$a), module$a.foo);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.