Enable sourcemaps in prod builds (for easier debugging of apps using Swiper) #3306
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sourcemaps are useful not only when developing Swiper itself, but also while debugging apps that use Swiper as a dependency. For example:
Currently, sourcemaps are not included with the prod builds that are the only builds published to the npm registry. To support the use-cases above, sourcemaps are needed for the production builds too.
This PR adds sourcemap support for Swiper 5.x prod builds. Changes include:
sourcemap: true
for all configs for various build types inscripts/build-js.js
.package/src
) where source files will be installed when the package is downloaded and installed from the npm registry.Note that this PR does not include the actual .map files themselves because those are generated by the build process, and I assumed that I should not include build output in a PR.