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?
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?
Comment