Where can I find the source for plugins/admin/themes/grav/js/admin.min.js?

I want to do some javascript stuff with the CodeMirror editor in Admin. I would love to take a good look at what’s in there already, and as far as I can see all the code is in user/plugins/admin/themes/grav/js/admin.min.js. But that file is minified and almost 2 MB in size… the minification being the bigger problem.

Can somebody maybe tell me where all that code comes from? It’s not just the CodeMirror stuff I think…? That would be super helpful :slight_smile:

@Netzhexe, If you open file user/plugins/admin/themes/grav/js/admin.min.js you will find the names of 79 files on which the webpack bundle has been build upon.

To name a few:


By the way, webpack is an asset bundler…

At its core, webpack is a static module bundler for modern JavaScript applications. When webpack processes your application, it internally builds a dependency graph which maps every module your project needs and generates one or more bundles .

Ah, my most consistent saviour…! :upside_down_face: Thank you for your reply. I admit I did not open that file because I checked it out on Github, and it was too big to display online, and so I thought it would be minified and hard to read anyway. However, I just looked and I actually don’t find any of those paths you mentioned, anywhere in the file. Just a loooooooooong line of minified javascript. Am I looking at the wrong version or something…?

@Netzhexe, Here are the first 16 unaltered lines of file user/plugins/admin/themes/grav/js/admin.min.js, showing a reference to ./app/dashboard/backup.js:

 * ATTENTION: An "eval-source-map" devtool has been used.
 * This devtool is not neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
var Grav;Grav =
/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./app/dashboard/backup.js":
  !*** ./app/dashboard/backup.js ***!

By the way, its contents may look minified, but it isn’t…

Heh. I actually did have an outdated version (Grav 1.7.0-something, and Admin around that date). I just updated and now the file looks so much nicer thank youuuuuu!

@Netzhexe, FYI, I’ve logged an issue because the Admin javascript libraries have been bundled with mode ‘development’ instead of ‘production’. That’s what makes the libs so large…

Oh and btw, also large files can be opened on Github, if you choose ‘raw’