I’m trying to load MathJax, but not from its CDN, but from local files (the server will be offline).
So:
- I downloaded MathJax: http://docs.mathjax.org/en/latest/installation.html#obtaining-mathjax-via-an-archive
- Placed the whole (2.7MB )in web/static/vendor/js/
- Load in the App (/web/templates/layout/app.html.eex):
<script src="<%= static_path(@conn, "/vendor/mathjax/MathJax.js") %>"></script>
- Configure brunch-config.js to precompile it (am i right?)
stylesheets: {
joinTo: "css/app.css",
order: {
before: [
"web/static/vendor/js/jquery.min.js",
"web/static/vendor/js/lodash.js",
"web/static/vendor/js/mathjax/MathJax.js"
],
after: ["web/static/css/app.css"] // concat app.css last
}
}
- When I start the server, it takes too long:
08 Sep 11:54:29 - info: compiling...
08 Sep 11:54:33 - info: compiling
08 Sep 11:54:37 - info: compiling.
08 Sep 11:54:42 - info: compiling..
08 Sep 11:54:48 - info: still compiling...
08 Sep 11:54:51 - info: compiled 264 files into 2 files, copied 3 in 54.2 sec
and the it crashes:
GET /vendor/mathjax/MathJax.js
[debug] ** (Phoenix.Router.NoRouteError) no route found for GET /vendor/mathjax/MathJax.js (Project.Router)
(plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
(cowboy) /vagrant/www/updevs_js/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
Why this happen? What do I need to do to load MathJax.js?