mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
packaging: reducing package size be only including public vendor stuff we need
This commit is contained in:
@@ -69,6 +69,7 @@ module.exports = function(grunt) {
|
||||
grunt.task.run('copy:public_gen_to_temp');
|
||||
grunt.task.run('copy:backend_bin');
|
||||
grunt.task.run('copy:backend_files');
|
||||
grunt.task.run('clean:packaging');
|
||||
|
||||
grunt.file.write(path.join(grunt.config('tempDir'), 'VERSION'), grunt.config('pkg.version'));
|
||||
});
|
||||
|
||||
@@ -5,6 +5,12 @@ module.exports = function(config) {
|
||||
release: ['<%= destDir %>', '<%= tempDir %>', '<%= genDir %>'],
|
||||
gen: ['<%= genDir %>'],
|
||||
temp: ['<%= tempDir %>'],
|
||||
css: ['<%= genDir %>/css']
|
||||
css: ['<%= genDir %>/css'],
|
||||
packaging: [
|
||||
'<%= tempDir %>/public/vendor/npm/rxjs',
|
||||
'<%= tempDir %>/public/vendor/npm/teather',
|
||||
'<%= tempDir %>/public/vendor/npm/teather-drop',
|
||||
'<%= tempDir %>/public/**/*.map',
|
||||
],
|
||||
};
|
||||
};
|
||||
|
||||
@@ -19,7 +19,10 @@ module.exports = function(config) {
|
||||
cwd: './node_modules',
|
||||
expand: true,
|
||||
src: [
|
||||
'ace-builds/src-noconflict/**/*',
|
||||
'jquery/dist/jquery.js',
|
||||
'lodash/lodash.js',
|
||||
'ace-builds/src-noconflict/ace.js',
|
||||
'ace-builds/src-noconflict/ext-language_tools.js',
|
||||
'eventemitter3/*.js',
|
||||
'systemjs/dist/*.js',
|
||||
'es6-promise/**/*',
|
||||
|
||||
@@ -2,6 +2,7 @@ module.exports = function(grunt) {
|
||||
"use strict";
|
||||
|
||||
grunt.registerTask('systemjs:build', function() {
|
||||
var path = require('path');
|
||||
var Builder = require('systemjs-builder');
|
||||
var done = this.async();
|
||||
|
||||
@@ -23,8 +24,15 @@ module.exports = function(grunt) {
|
||||
|
||||
builder
|
||||
.bundle(expression, 'public_gen/app/app_bundle.js')
|
||||
.then(function() {
|
||||
console.log('Build complete');
|
||||
.then(function(res) {
|
||||
console.log('Build complete', res.modules);
|
||||
|
||||
for (var i = 0; i < res.modules.length; i++) {
|
||||
var modulePath = path.join('public_gen', res.modules[i]);
|
||||
console.log(modulePath);
|
||||
grunt.file.delete(modulePath);
|
||||
}
|
||||
|
||||
done();
|
||||
grunt.task.run('concat:bundle_and_boot');
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user