Skip to content

[Feature]: Support asset module #570

Open
0 of 4 issues completed
Open
Enhancement
0 of 4 issues completed
@SoonIter

Description

What problem does this feature solve?

Support asset module based on publicPath: 'auto'

Bundle

Bundleless

final

  • Rslib: set output.publicPath: 'auto' by default for esm/cjs format

What does the proposed API look like?

input

└── src
    ├── assets
    │   └── logo.svg   // <--
    └── index.tsx
// index.tsx
import foo from './assets/logo.svg';
console.log(foo);

output

./dist
└── esm
    ├── assets
    │   └── logo.mjs     // <--
    ├── static/svg
    │   └── logo.svg     // <--
    ├── index.d.ts
    └── index.mjs
// dist/esm/assets/logo.mjs
import url from '../static/svg/logo.svg';
export default url;
// dist/esm/index.mjs
import foo from './assets/logo.mjs';
console.log(foo);

Sub-issues

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions