What problem does this feature solve?
At present, we externalize all request in bundleless mode, which means transform the source code.
For example, when users want to import raw CSS files as strings in JavaScript by using the ?raw query parameter in bundleless mode to avoid processing in app side since some app bundlers may not have some loader or users want to reduce loader processing in app side.
What does the proposed API look like?
Source code
import reactToastifyRootStyles from "react-toastify/dist/ReactToastify.css?raw";
const reactToastifyHostStyles = reactToastifyRootStyles.replaceAll(
":root",
":host"
);
console.log("reactToastifyHostStyles: ", reactToastifyHostStyles);
Actual
import * as __WEBPACK_EXTERNAL_MODULE_react_toastify_dist_ReactToastify_css_raw_922fb197__ from "react-toastify/dist/ReactToastify.css?raw";
const reactToastifyHostStyles = __WEBPACK_EXTERNAL_MODULE_react_toastify_dist_ReactToastify_css_raw_922fb197__["default"].replaceAll(":root", ":host");
console.log("reactToastifyHostStyles: ", reactToastifyHostStyles);
Expected
const ReactToastifyraw_namespaceObject = "";
const reactToastifyHostStyles = ReactToastifyraw_namespaceObject.replaceAll(
":root",
":host"
);
console.log("reactToastifyHostStyles: ", reactToastifyHostStyles);
What problem does this feature solve?
At present, we externalize all request in bundleless mode, which means transform the source code.
For example, when users want to import raw CSS files as strings in JavaScript by using the
?rawquery parameter in bundleless mode to avoid processing in app side since some app bundlers may not have some loader or users want to reduce loader processing in app side.What does the proposed API look like?
Source code
Actual
Expected