@build-script/rollup-plugin-module-import-dew
TypeScript icon, indicating that this package has built-in type declarations

1.0.19 • Public • Published

rollup-plugin-module-import-dew

Note: default export is not for you, do not use it anymore! Named export instead.

Goal

Convert anything like this:

import Button, { ButtonProps } from 'some-library/button.js';

into:

import { dew as _dew1 } from 'some-library/button.dew.js';
const _dew1_default = _dew1().default;
const Button = _dew1_default;
const { ButtonProps } = _dew1_default;

Why?

Because "dew format can only imported by another module converted to dew format"

You have two way to use Button:

  1. ReactDOM.render(<Button.default />, someDiv); - this is simply invalid in TypeScript
  2. compile to commonjs and then convert to dew format - use babel-plugin-transform-cjs-dew.
  3. do some simple replace in module files - this package will do.

Api

Readme

Keywords

none

Package Sidebar

Install

npm i @build-script/rollup-plugin-module-import-dew

Weekly Downloads

13

Version

1.0.19

License

MIT

Unpacked Size

16.5 kB

Total Files

11

Last publish

Collaborators

  • gongt