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

Enable sourcemaps in prod builds (for easier debugging of apps using Swiper) #3306

Merged
merged 1 commit into from
Oct 26, 2019

Conversation

justingrant
Copy link
Contributor

Sourcemaps are useful not only when developing Swiper itself, but also while debugging apps that use Swiper as a dependency. For example:

  • setting breakpoints inside Swiper code
  • clearer call stacks that include Swiper code
  • being able to Step Into Swiper's original source in a debugger like VSCode

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:

  • Copying the /src directory into /package/src so that the source will be published to npm.
  • Enabling sourcemap files to be generated by setting sourcemap: true for all configs for various build types in scripts/build-js.js.
  • Fixing up the paths inside sourcemaps to point to the actual location (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.

@nolimits4web nolimits4web merged commit 9ebaa89 into nolimits4web:master Oct 26, 2019
@nolimits4web
Copy link
Owner

Looks good, thanks!

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