webui/config-overrides.js
2026-01-20 21:48:51 +00:00

77 lines
2.8 KiB
JavaScript

//const { styles } = require( '@ckeditor/ckeditor5-dev-utils' );
module.exports = function override(config, env) {
if (!config.plugins) {
config.plugins = [];
}
for ( const rule of config.module.rules )
{
if (rule.oneOf !== undefined) {
//loader: require.resolve('file-loader'),
rule.oneOf[2].use[1].options = {
// Exclude `js` files to keep the "css" loader working as it injects
// its runtime that would otherwise be processed through the "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpack's internal loaders.
exclude: [
/\.(js|mjs|jsx|ts|tsx)$/,
/\.html$/,
/\.json$/,
/ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/,
/ckeditor5-[^/\\]+[/\\]theme[/\\].+\.css$/
],
name: 'static/media/[name].[hash:8].[ext]',
}
//test: cssRegex,
rule.oneOf[5].exclude = [
/\.module\.css$/,
/ckeditor5-[^/\\]+[/\\]theme[/\\].+\.css$/,
];
//test: cssModuleRegex,
rule.oneOf[6].exclude = [
/ckeditor5-[^/\\]+[/\\]theme[/\\].+\.css$/,
];
//Added items
// rule.oneOf.unshift( {
// test: /ckeditor5-[^/\\]+[/\\]theme[/\\].+\.css$/,
// use: [
// {
// loader: 'style-loader',
// options: {
// injectType: 'singletonStyleTag',
// attributes: {
// 'data-cke': true
// }
// }
// },
// 'css-loader',
// {
// loader: 'postcss-loader',
// options: {
// postcssOptions: styles.getPostCssConfig( {
// themeImporter: {
// themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' )
// },
// minify: true
// } )
// }
// }
// ]
// }
// );
// rule.oneOf.unshift( {
// test: /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/,
// use: [ 'raw-loader' ]
// }
// );
}
}
return config;
}