docs/javascripts
Kevin Heis 3ea7737a9b
Update scroll-up.js
2021-02-23 08:55:01 -08:00
..
README.md Hello git history spelunker! 2020-09-27 14:10:11 +02:00
airgap-links.js Block a few more things in AIRGAP (#17657) 2021-02-09 23:07:23 +00:00
all-articles.js "All articles" component of Actions landing page (#16318) 2020-11-12 12:57:30 -05:00
copy-code.js Reduce minified JS bundle size from 189kb to 73kb (#17552) 2021-01-28 22:12:04 +00:00
dev-toc.js fix Expand and Close toggling 2020-11-17 11:35:19 -05:00
display-platform-specific-content.js Reduce minified JS bundle size from 189kb to 73kb (#17552) 2021-01-28 22:12:04 +00:00
events.js Move the one performance metric in page to exit to avoid join (#17784) 2021-02-11 16:28:07 +00:00
experiment.js End survey stars AB test (#17907) 2021-02-22 18:27:57 +00:00
explorer.js Check repository references (#16680) 2020-12-03 16:41:03 +00:00
filter-cards.js Add topic property and filter to guides page (#17328) 2021-01-29 12:32:31 +00:00
get-csrf.js Inline CSRF token in HTML (#17748) 2021-02-09 22:08:24 +00:00
helpfulness.js End survey stars AB test (#17907) 2021-02-22 18:27:57 +00:00
hyperscript.js Convert em to mark in search results (#17391) 2021-01-20 21:33:31 +00:00
index.js Merge branch 'main' into add-button-for-scrolling-to-top 2021-02-22 14:40:16 -08:00
localization.js Hello git history spelunker! 2020-09-27 14:10:11 +02:00
nav.js return early instead of erroring out on nonstandard page 2020-11-16 20:42:26 -05:00
print.js A couple of tweaks to release notes page (#16934) 2020-12-14 22:01:14 +00:00
release-notes.js [DO NOT MERGE] GitHub Enterprise Server 3.0 release candidate megabranch (#16479) 2021-01-13 19:16:05 -08:00
scroll-up.js Update scroll-up.js 2021-02-23 08:55:01 -08:00
search.js Block a few more things in AIRGAP (#17657) 2021-02-09 23:07:23 +00:00
show-more.js Sublanding page all guides section (#16869) 2021-01-18 12:23:23 +00:00
sidebar.js remove inactive sidebar links (#16500) 2020-11-17 14:26:14 -08:00
user-agent.js Create a user agent parser for analytics (#15915) 2020-10-21 07:43:09 -07:00
wrap-code-terms.js Reduce minified JS bundle size from 189kb to 73kb (#17552) 2021-01-28 22:12:04 +00:00

README.md

Javascripts

The code in this directory is destined to run in a web browser!

The index.js file in this directory is bundled by Webpack. In development, we use webpack-dev-middleware to bundle automatically while running the server. In production, we run webpack --mode production via npm run build.

This file is then referenced in the footer:

<script src="/dist/index.js"></script>

Every other file in this directory is written as a module to be required in index.js. They all have this format:

module.exports = () => {
  // Do some cool browser stuff
  // Note: by the time this runs, the DOM will be ready. :)
}

In development, the bundle will recompile every time a file used by javascripts/index.js is changed. This ensures that you're always getting an up-to-date version of the script.

In production, the bundle is compiled during build-time.