Support new `export * as ns` syntax
See original GitHub issueFeature request
There is new export syntax: export * as ns (stage 4).
https://github.com/tc39/proposal-export-ns-from
export * as ns from './test';
Currently this will error:
ERROR in ./src/proxy.js 1:9
Module parse failed: Unexpected token (1:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> export * as ns from './test';
@ ./src/index.js 1:0-29 2:12-14
FWIW, TypeScript recently added support for this: https://devblogs.microsoft.com/typescript/announcing-typescript-3-8/#export-star-as-namespace-syntax
What is the expected behavior?
What is motivation or use case for adding/changing the behavior?
How should this be implemented in your opinion?
Are you willing to work on this yourself? yes
Issue Analytics
- State:
- Created 4 years ago
- Reactions:23
- Comments:16 (3 by maintainers)
Top Results From Across the Web
ECMAScript export ns from
This proposal adds a new form of "export from" which exports another module's namespace exotic object as an exported name of another, filling...
Read more >export - JavaScript - MDN Web Docs
The export declaration is used to export values from a JavaScript module. Exported values can then be imported into other programs with the ......
Read more >Documentation - TypeScript 3.8
TypeScript 3.8 adds a new syntax for type-only imports and exports. ts. import type { SomeThing } from "./some-module.js";. export type { SomeThing...
Read more >Modules • JavaScript for impatient programmers (ES2022 ...
Syntax (how code is written): What is a module? How are imports and exports declared? Etc. Semantics (how code is executed): How are...
Read more >How To Use Modules in TypeScript
TypeScript offers support for creating and using modules with a unified ... The export {} syntax allows you to export multiple identifiers.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

A current workaround is to use Babel and its @babel/plugin-proposal-export-namespace-from plugin. You can set is up like so for bare-minimum babel:
For dependencies,
In your
webpack.config.js,Is this the same issue as https://github.com/TypeStrong/ts-loader/issues/1121?
If you use a module target lower than es2020 then typescript will transpile the new export * syntax down to a version webpack can understand.