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

Don't resolve the shared.js to the full local path #33

Merged
merged 1 commit into from
Dec 20, 2017

Conversation

jacwright
Copy link
Contributor

Using the full local path exposes security/privacy issues when svelte components are provided as NPM modules. The compiled code includes the path information in the variable names. This also bloats the code, which isn't as much an issue since it eventually gets compressed with libraries such as uglify. The bigger issue is the local path information being publicized this way.

Are there any issues with removing require.resolve? Svelte should be available without it, but perhaps there are edge cases I cannot think of.

See #29

Using the full local path exposes security/privacy issues when svelte components are provided as NPM modules. The compiled code includes the path information in the variable names. This also bloats the code, which isn't as much an issue since it eventually gets compressed with libraries such as uglify. The bigger issue is the local path information being publicized this way.

Are there any issues with removing `require.resolve`? Svelte should be available without it, but perhaps there are edge cases I cannot think of.

See sveltejs#29
@Rich-Harris Rich-Harris merged commit 0a800b8 into sveltejs:master Dec 20, 2017
@Rich-Harris
Copy link
Member

Thanks. The reason for the require.resolve is historical, I think — at one stage svelte was a dependency rather than a peer dependency, which meant that it was necessary to resolve it. (Or maybe that was just the case in the Rollup plugin, and the code was copied over?) In any case, I don't think it serves any further use.

@jacwright jacwright deleted the patch-1 branch December 20, 2017 22:40
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.

2 participants