Fix document

This commit is contained in:
mfrachet 2021-10-01 10:00:00 +02:00
parent 1c2a1c8d89
commit 988225f6cd

View File

@ -95,10 +95,11 @@ async function createPluginsJs(plugins, dest) {
/**
* path.join, on windows, it uses backslashes to resolve path.
* The problem is that JavaScript does not resolve the path as windows.
* In JavaScript, we need to rely on "/" and not "\".
* This is the reason why '..\\..\\..\\node_modules\\@strapi\\plugin-content-type-builder/strapi-admin.js' was not working in javascript.
* The regexp at line 105 aims to replace the windows backslashes by standard slash so that javascript can deal with them.
* The problem is that Webpack does not windows paths
* With this tool, we need to rely on "/" and not "\".
* This is the reason why '..\\..\\..\\node_modules\\@strapi\\plugin-content-type-builder/strapi-admin.js' was not working.
* The regexp at line 105 aims to replace the windows backslashes by standard slash so that webpack can deal with them.
* Backslash looks to work only for absolute paths with webpack => https://webpack.js.org/concepts/module-resolution/#absolute-paths
*/
const realPath = path
.join(path.relative(path.resolve(dest, 'admin', 'src'), pathToPlugin), 'strapi-admin.js')