@lynx-js/rspeedy
Version:
A webpack/rspack-based frontend toolchain for Lynx
47 lines (46 loc) • 2.03 kB
JavaScript
export const __webpack_ids__ = [
"src_plugins_output_plugin_ts"
];
export const __webpack_modules__ = {
"./src/config/output/dist-path.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
A: ()=>DEFAULT_DIST_PATH_INTERMEDIATE
});
const DEFAULT_DIST_PATH_INTERMEDIATE = '.rspeedy';
},
"./src/plugins/output.plugin.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
pluginOutput: ()=>pluginOutput
});
var _config_output_dist_path_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/config/output/dist-path.ts");
const defaultFilenameOptions = Object.freeze({
css: '[name]/[name].css'
});
const defaultDistPathOptions = Object.freeze({
css: _config_output_dist_path_js__WEBPACK_IMPORTED_MODULE_0__.A
});
function pluginOutput(options) {
return {
name: 'lynx:rsbuild:output',
setup (api) {
api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>{
if (!options) return mergeRsbuildConfig({
output: {
filename: {
css: defaultFilenameOptions.css
}
}
}, config);
return mergeRsbuildConfig(config, {
output: {
distPath: Object.assign({}, defaultDistPathOptions, options.distPath),
filename: Object.assign({}, defaultFilenameOptions, options.filename)
}
});
});
}
};
}
}
};