@build-script/rollup-plugin-module-import-dew
v1.0.19
Published
Convert (TypeScript compiled) module's import statements, to work with jspm dew file.
Downloads
19
Readme
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
:
ReactDOM.render(<Button.default />, someDiv);
- this is simply invalid in TypeScript- compile to commonjs and then convert to dew format - use
babel-plugin-transform-cjs-dew
. - do some simple replace in module files - this package will do.
Api