Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow symlinks during webpack build #33517

Merged
merged 2 commits into from
Aug 13, 2022
Merged

Allow symlinks during webpack build #33517

merged 2 commits into from
Aug 13, 2022

Conversation

juliushaertl
Copy link
Member

@juliushaertl juliushaertl commented Aug 12, 2022

Make sure that symlinked node_modules are properly handled by webpack in case of using npm link.

There is currently one issue during the watch with @nextcloud/vue where it cannot resolve jquery which tributejs is pulling in which then cannot be resolved as the parent node modules of @nextcloud/vue do not contain it. This is only an issue if components that use the rich content editor and only during linking as in other cases the jquery dependency would be found in the server node_modules. As a fix we could add jquery to the vue library as a dependency, which shouldn't matter in terms of building as those are marked as external anyways.

While tribute.js doesn't require query it checks for its presence which webpack is trying to fill through the ProvidePlugin:

https://github.com/nextcloud/server/blob/master/webpack.common.js#L144

This causes the following tribute.js code to fail then as it tires to resolve it from the linked path:

~/repos/nextcloud/@nextcloud/nextcloud-vue bugfix/noid/popover-focus-trap✦ ➜ rg jQuery node_modules/tributejs/dist/tribute.esm.js
1497:    // Check if it is a jQuery collection
1498:    if (typeof jQuery !== "undefined" && el instanceof jQuery) {
1788:    // Check if it is a jQuery collection
1789:    if (typeof jQuery !== "undefined" && el instanceof jQuery) {

Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliushaertl
Copy link
Member Author

Pushed another commit to properly handle the tribute.js/jquery situation and updated the PR description.

@skjnldsv skjnldsv added the 4. to release Ready to be released and/or waiting for tests to finish label Aug 13, 2022
@skjnldsv skjnldsv merged commit 1faf460 into master Aug 13, 2022
@skjnldsv skjnldsv deleted the bugfix/noid/npm-link branch August 13, 2022 09:25
@skjnldsv skjnldsv mentioned this pull request Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants