dojo / cli-build-widget

Command for building Dojo widgets
Other
6 stars 17 forks source link

The image is packaged but corrupted in some way during the build #104

Closed xiaohulu closed 3 years ago

xiaohulu commented 3 years ago

There is a a.jpg image at assets folder.

Then I require a.jpg at Home.ts

const png1 = require("../assets/a.jpg");
const factory = create();

export default factory(function Profile() {
    return v('h1', { classes: [css.root] }, [
        'Home Page',
        v('img', {src: png1})
    ]);
});

then run npm run build(dojo build widget --mode dist --target lib) to build a dojo library, build success, but a.jpg can not open.

demo https://github.com/xiaohulu/dojo-picture