Description
What problem does this feature solve?
Support asset module based on publicPath: 'auto'
Bundle
-
css
- Rslib: support preserve relative path in
publicPath: auto
feat(css): support css asset in bundle mode and esm/cjs #573
- Rslib: support preserve relative path in
-
js
- Rspack: support
module.generator.experimentalLibPreserveImport
in feat(plugin-asset): supportexperimentalLibPreserveImport
in asset for Rslib rspack#8724
- Rspack: support
Bundleless
-
css
- Rslib: Support
__mini_css_extract_plugin_public_path_auto__
place-holder https://github.com/web-infra-dev/rspack/blob/dfb1734c626290250acb40140460c0c1022335ac/crates/rspack_plugin_extract_css/src/plugin.rs#L45 in lib-css-extract-loader feat(css): support css asset in bundleless mode and esm/cjs #582
- Rslib: Support
-
js
- Rspack: [Feature]: Support
publicPath: auto
in asset module rspack#8748 - Rspack: support
module.generator['asset'].experimentalLibReExport
in feat(plugin-asset): supportexperimentalLibPreserveImport
in asset for Rslib rspack#8724
- Rspack: [Feature]: Support
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);