google / google/closure-compiler
Preserve the export statements of specific modules
Open
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
Assessment
This issue has not been assessed yet.