Skip to content

hqjs/babel-plugin-transform-named-export-to-destructure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transform named export to destructure.

Installation

npm install hqjs@babel-plugin-transform-named-export-to-destructure

Transformation

Plugin makes destructure export work with modules that only provide default export.

export { default } from './CssBaseline';
import css from '@emotion/css';
console.log(css);
export { default as css } from '@emotion/css';
import {x as y, h as l} from 'z';
console.log(y);
export {x as y} from 'z';
export {a} from 'zz';
console.log(a);
import {a, b} from 'zz';
import * as w from 'zzz';
console.log(w);
export * as w from 'zzz';

will turn into

import { default as _ref } from './CssBaseline';
export default _ref;
import { default as _ref2 } from '@emotion/css';
export const css = _ref2;
console.log(css);
import { x as _ref3, h as l } from 'z';
export const y = _ref3;
console.log(y);
import { a as _ref4 } from 'zz';
export const a = _ref4;
console.log(a);
import { b } from 'zz';
import * as _ref5 from 'zzz';
export const w = _ref5;
console.log(w);

About

Transform exportd to import with destructure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published