mirror of
https://github.com/strapi/strapi.git
synced 2025-09-17 12:27:33 +00:00
Fix plugins routes in admin file generator
This commit is contained in:
parent
328228fced
commit
ecfd1ce836
@ -22,21 +22,23 @@ module.exports = {
|
|||||||
// Use `cheerio` to parse the HTML string
|
// Use `cheerio` to parse the HTML string
|
||||||
const parsedHTML = $.load(htmlString);
|
const parsedHTML = $.load(htmlString);
|
||||||
|
|
||||||
// // Some plugins are ignored
|
// Some plugins are ignored
|
||||||
// const ignoredPlugins = ['admin', 'user'];
|
const ignoredPlugins = ['admin', 'user'];
|
||||||
//
|
|
||||||
// // Inject `js` files from plugins builds in the main admin panel
|
console.log('strapi.plugins', strapi.plugins)
|
||||||
// _.forEach(strapi.api, (value, pluginName) => {
|
|
||||||
// if (!_.includes(ignoredPlugins, pluginName)) {
|
// Inject `js` files from plugins builds in the main admin panel
|
||||||
// // Main plugin `js` file
|
_.forEach(strapi.plugins, (value, pluginName) => {
|
||||||
// const pluginMainScript = $('<script>').attr('src', '/plugins/' + pluginName + '/main.js');
|
if (!_.includes(ignoredPlugins, pluginName)) {
|
||||||
// parsedHTML('body').append(pluginMainScript);
|
// Main plugin `js` file
|
||||||
//
|
const pluginMainScript = $('<script>').attr('src', '/' + pluginName + '/main.js');
|
||||||
// // Vendors plugin `js` file
|
parsedHTML('body').append(pluginMainScript);
|
||||||
// const pluginVendorScript = $('<script>').attr('src', '/plugins/' + pluginName + '/vendor.js');
|
|
||||||
// parsedHTML('body').append(pluginVendorScript);
|
// Vendors plugin `js` file
|
||||||
// }
|
const pluginVendorScript = $('<script>').attr('src', '/' + pluginName + '/vendor.js');
|
||||||
// });
|
parsedHTML('body').append(pluginVendorScript);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Finally, send the HTML file with injected scripts
|
// Finally, send the HTML file with injected scripts
|
||||||
this.body = parsedHTML.html();
|
this.body = parsedHTML.html();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user