Open pomek opened 1 year ago
The same applies to https://github.com/ckeditor/ckeditor5-package-generator/blob/8f40903157ece7a32c16722645b672d91f8b8c03/packages/ckeditor5-package-tools/lib/utils/get-webpack-config-dll.js#L30-L31
Fix:
// An absolute path to the manifest file that the `DllReferencePlugin` plugin uses for mapping dependencies.
const ckeditor5manifestPath = require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' );
TLDR:
Can be fixed using yarn patch
and changing getThemePath
function from lib/utils
:
const packageJsonPath = require.resolve( '@ckeditor/ckeditor5-theme-lark/package.json');
const packageJson = require(packageJsonPath);
const packagePath = path.join(packageJsonPath, '..');
There are two workarounds:
"packages/ckeditor5-whatever/package.json
"installConfig": {
"hoistingLimits": "dependencies"
}
But this is very bad as dependencies are duplicated during installation
yarn patch
Tried to solve this issue using yarn patch
command and applying your fixes. It really works. but still somethig is wrong:
Seems like some theme deps still not loaded correctly
UPD:
The reason is that original path.join( cwd, 'node_modules', '@ckeditor', 'ckeditor5-theme-lark' );
results in package dir path, while require.resolve( '@ckeditor/ckeditor5-theme-lark/package.json' );
results in package.json path.
The correct fix will be
module.exports = function getThemePath( cwd ) {
const packageJsonPath = require.resolve( '@ckeditor/ckeditor5-theme-lark/package.json');
const packageJson = require(packageJsonPath);
const packagePath = path.join(packageJsonPath, '..');
return path.join( packagePath, packageJson.main );
};
P.S. Trying to resolve require.resolve( '@ckeditor/ckeditor5-theme-lark');
gives .../node_modules/@ckeditor/ckeditor5-theme-lark/theme/theme.css
so this is not an option
Hope this will be in release someday
📝 Provide detailed reproduction steps (if any)
yarn start
✔️ Expected result
It does not throw any errors.
❌ Actual result
❓ Possible solution
package.json
file fromnode_modules/
insideckeditor5-foo
.