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

chore: make share.js work with webpack #1048

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

pano9000
Copy link
Contributor

Hi,

this PR allows for webpack to take care of the share.js file – without losing the "fetchNote" functionality.
This involves a small "workaround" in the share.js, to avoid Webpack from treating it as dead code – I was trying to get the same result by using webpack config flags, but was not able to get the correct results.

Since we now have webpack taking care of the share.js:

  • we can port it to TS (which I did here as well)
  • we can get rid of the manual copying of the file in the Dockerfile and the copy-trilium.sh build scripts.

this also should fix #1029

since fetchNote function is not used anywhere, webpack will treat it as "dead code" and remove it from the final output

I did not have any success with using webpack config flags like "sideEffects", so I've reverted to this workaround for now
this is now correctly handled by the webpack build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Bug report) share.js broken on share pages on v0.91.3-beta
1 participant