зеркало из https://github.com/github/docs.git
c594dff941 | ||
---|---|---|
.. | ||
README.md | ||
airgap-links.ts | ||
all-articles.ts | ||
browser-date-formatter.d.ts | ||
copy-code.ts | ||
dev-toc.ts | ||
display-platform-specific-content.ts | ||
display-tool-specific-content.ts | ||
events.ts | ||
experiment.ts | ||
explorer.ts | ||
filter-cards.ts | ||
get-csrf.ts | ||
hyperscript.ts | ||
index.ts | ||
localization.ts | ||
nav.ts | ||
print.ts | ||
release-notes.ts | ||
scroll-anchoring.d.ts | ||
scroll-up.ts | ||
search-with-your-keyboard.d.ts | ||
search.ts | ||
set-next-env.ts | ||
show-more.ts | ||
sidebar.ts | ||
survey.ts | ||
toggle-images.ts | ||
user-agent.ts | ||
wrap-code-terms.ts |
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.