Rebuilding espo.min.js

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stan.riley
    Junior Member
    • Jan 2019
    • 4

    Rebuilding espo.min.js

    Hello,
    I am trying to rebuild espo.min.js. I have a Gruntfile.js using uglify and it seems to be including the lib and the src javascripts and creating the espo.min.js file. That file will have problems when I clear cache, replace the original espo.min.js with the one I built, and try to run espo crm. Is order of the libraries or source files added important?

    Here is my Gruntfile.js
    =============================
    module.exports = function (grunt) {
    grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    // define source files and their destinations
    uglify: {
    options: {
    mangle: false,
    banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
    },

    files: {
    src: [
    './lib/**/*.*',
    './src/**/*.*'], // source files mask
    dest: './build/espo.min.js', // destination folder
    // expand: true, // allow dynamic building
    // flatten: true, // remove all unnecessary nesting
    // ext: '.min.js' // replace .js to .min.js
    }
    },

    watch: {
    js: { files: 'js/*.js', tasks: [ 'uglify' ] },
    }
    });

    // load plugins
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-uglify');

    // register at least this one task
    grunt.registerTask('default', [ 'uglify' ]);

    };
    ===================================

    package.json
    {
    "name": "client",
    "version": "1.0.0",
    "description": "",
    "main": "Gruntfile.js",
    "directories": {
    "lib": "lib"
    },
    "dependencies": {
    "grunt": "^1.0.3",
    "grunt-cli": "^1.3.2",
    "grunt-contrib-uglify": "^4.0.0",
    "grunt-contrib-watch": "^1.1.0"
    },
    "devDependencies": {},
    "scripts": {
    "test": "echo "Error: no test specified" && exit 1"
    },
    "author": "",
    "license": "ISC"
    }




    Can someone please reply what I am doing wrong?
  • stan.riley
    Junior Member
    • Jan 2019
    • 4

    #2
    OK. Dont reply. I thought I could simply just rebuild the JS. WRONG!!! I see that there is a more complex build in the Github repo. Developers should clone the espocrm repo and follow instructions in the readme. Sorry.

    Comment

    • agudek
      Junior Member
      • Aug 2018
      • 4

      #3
      Hey, do you know if there is an easy way to switch from stable version to the GitHub version? I need to rebuild espo.min.js as well, but don't have the gulp file. And I don't want to move over all the changes I made in the current version, as that will be a total pain..

      Comment

      Working...