Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Add support for sourcemap *.map files #204

Merged
merged 3 commits into from
Mar 19, 2018

Conversation

nolanlawson
Copy link
Contributor

For some apps I'd like to enable source maps in production. However this causes the following output for %sapper.scripts%:

<script src='/client/<hash>/main.js'></script>
<script src='/client/<hash>/main.js.map'></script>

This PR fixes it so that Sapper outputs:

<script src='/client/<hash>/main.js'></script>

@nolanlawson nolanlawson changed the title Ignore source map files in %sapper.scripts% Add support for sourcemap *.map files Mar 18, 2018
@nolanlawson
Copy link
Contributor Author

I realized my previous PR was incomplete. This new commit adds full support for .map files, for both sapper start and sapper export, for both the client and the service worker.

So now a user can, for instance, put the following configuration into client.config.js or service-worker.config.js:

devtool: isDev ? 'inline-source-map' : 'source-map'

...and all the *.map files will be correctly served and exported.

@nolanlawson
Copy link
Contributor Author

Last change: there's no sense in adding <link rel=preload> for .map files.

@Rich-Harris Rich-Harris merged commit 66ac977 into sveltejs:master Mar 19, 2018
@Rich-Harris
Copy link
Member

sweet, thanks! cutting a release shortly

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants