RichFilemanager icon indicating copy to clipboard operation
RichFilemanager copied to clipboard

Fetch most dependencies via NPM

Open tinogo opened this issue 6 years ago • 1 comments

This MR will unversion most of the bundled libs (except those libs, which have some kind of customization...) and load them via NPM instead.

This makes it possible to considerably cut down the size of the dist package and this also works around a vulnerability of the jQuery-File-Upload plugin, as the PHP connector/adapter isn't versioned anymore! :)

I hope it haven't broke anything?! :)

tinogo avatar Jan 29 '19 00:01 tinogo

I had some issues getting this to work:

  • src/scss/codemirror.scss => I had to remove the .css extension before grunt would include the actual content of the file
  • In the gruntfile I had to:
    • import node-sass "on top" => const sass = require('node-sass');
    • add "implementation" option => sass: { options: { implementation: sass } }
    • Disable the mangle option (it didn't check which dependency was out of scope) => uglify: { options: { mangle: false } }

I also updated packages.json, so that might be causing some of the above issues (especially in the gruntfile config)

{
"devDependencies": {
    "grunt": "^1.0.4",
    "grunt-contrib-concat": "^1.0.1",
    "grunt-contrib-copy": "^1.0.0",
    "grunt-contrib-cssmin": "^3.0.0",
    "grunt-contrib-uglify": "^1.0.1",
    "grunt-sass": "^3.0.2",
    "node-sass": "^4.11.0",
    "npm-run-all": "^4.0.2",
    "uglify-js": "^3.0.27"
  },
  "dependencies": {
    "@allmarkedup/purl": "git+https://github.com/allmarkedup/purl.git",
    "blueimp-file-upload": "^9.12.1",
    "blueimp-load-image": "^2.6.1",
    "blueimp-tmpl": "^3.3.0",
    "clipboard": "^2.0.4",
    "codemirror": "^5.35.0",
    "globalize": "^1.3.0",
    "highlightjs": "^9.12.0",
    "jquery": "^3.4.0",
    "jquery-contextmenu": "^2.0.1",
    "jquery-file-download": "^1.4.6",
    "jquery-mousewheel": "^3.1.13",
    "jquery-splitter": "git+https://github.com/GerHobbelt/splitter.git",
    "knockout": "^3.4.0",
    "malihu-custom-scrollbar-plugin": "^3.1.3",
    "markdown-it": "^8.2.2",
    "markdown-it-footnote": "^3.0.1",
    "markdown-it-replace-link": "^1.0.0",
    "pyrsmk-toast": "^2.2.0"
  }
}

At first glance all seems to work for us.

KevVerF avatar Apr 24 '19 13:04 KevVerF