mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 15:27:47 -02:30
Update UI build system
* Faster build times * Smaller bundle sizes * Adjust paths * Cleanup npm dependencies * Remove unneded Grunt tasks
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
var django_port = process.env.npm_package_config_django_port,
|
||||
django_host = process.env.npm_package_config_django_host;
|
||||
|
||||
module.exports = {
|
||||
http: {
|
||||
bsFiles: {
|
||||
src: [
|
||||
'static/**/*',
|
||||
'!static/tower.vendor.js',
|
||||
'!static/tower.vendor.map.js',
|
||||
'!static/tower.js.map'
|
||||
]
|
||||
},
|
||||
options: {
|
||||
proxy: {
|
||||
target: `https://${django_host}:${django_port}`,
|
||||
ws: true
|
||||
},
|
||||
keepalive: false,
|
||||
watchTask: true,
|
||||
reloadDebounce: 1000,
|
||||
// The browser-sync-client lib will write your current scroll position to window.name
|
||||
// https://github.com/BrowserSync/browser-sync-client/blob/a2718faa91e11553feca7a3962313bf1ec6ba3e5/dist/index.js#L500
|
||||
// This strategy is enabled in the core browser-sync lib, and not externally documented as an option. Yay!
|
||||
// https://github.com/BrowserSync/browser-sync/blob/a522aaf12b6167d5591ed285eb3086f43a4d9ac2/lib/default-config.js#L312
|
||||
scrollRestoreTechnique: null,
|
||||
injectChanges: true
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,7 +0,0 @@
|
||||
module.exports = {
|
||||
options: { force: true },
|
||||
static: 'static/*',
|
||||
coverage: 'coverage/*',
|
||||
tmp: '../../tmp',
|
||||
jshint: 'coverage/jshint.xml'
|
||||
};
|
||||
@@ -1,17 +0,0 @@
|
||||
module.exports = {
|
||||
css: {
|
||||
src: [
|
||||
'static/assets/custom-theme/jquery-ui-1.10.3.custom.min.css',
|
||||
'static/assets/ansible-bootstrap.min.css',
|
||||
'static/assets/fontcustom/fontcustom.css',
|
||||
'static/lib/components-font-awesome/css/font-awesome.min.css',
|
||||
'static/lib/select2/dist/css/select2.css',
|
||||
'static/lib/codemirror/lib/codemirror.css',
|
||||
'static/lib/codemirror/theme/elegant.css',
|
||||
'static/lib/codemirror/addon/lint/lint.css',
|
||||
'static/lib/nvd3/build/nv.d3.css',
|
||||
'static/lib/ng-toast/dist/ngToast.min.css'
|
||||
],
|
||||
dest: 'static/css/app.vendor.css'
|
||||
}
|
||||
};
|
||||
@@ -1,61 +0,0 @@
|
||||
module.exports = {
|
||||
dev: {
|
||||
tasks: [
|
||||
'copy:vendor',
|
||||
'copy:assets',
|
||||
'copy:icons',
|
||||
'copy:fonts',
|
||||
'copy:images',
|
||||
'copy:partials',
|
||||
'copy:views',
|
||||
'copy:languages',
|
||||
'copy:config',
|
||||
'less:dev'
|
||||
]
|
||||
},
|
||||
// This concurrent target is intended for development ui builds that do not require raising browser-sync or filesystem polling
|
||||
devNoSync: {
|
||||
tasks: [
|
||||
'copy:vendor',
|
||||
'copy:assets',
|
||||
'copy:icons',
|
||||
'copy:fonts',
|
||||
'copy:images',
|
||||
'copy:partials',
|
||||
'copy:views',
|
||||
'copy:languages',
|
||||
'copy:config',
|
||||
'less:dev',
|
||||
'webpack:dev'
|
||||
]
|
||||
},
|
||||
prod: {
|
||||
tasks: [
|
||||
'newer:copy:vendor',
|
||||
'newer:copy:assets',
|
||||
'newer:copy:icons',
|
||||
'newer:copy:fonts',
|
||||
'newer:copy:images',
|
||||
'newer:copy:partials',
|
||||
'newer:copy:views',
|
||||
'newer:copy:languages',
|
||||
'newer:copy:config',
|
||||
'newer:less:prod'
|
||||
]
|
||||
},
|
||||
watch: {
|
||||
tasks: [
|
||||
'watch:css',
|
||||
'watch:partials',
|
||||
'watch:views',
|
||||
'watch:assets',
|
||||
[
|
||||
'watch:config'
|
||||
]
|
||||
],
|
||||
options: {
|
||||
logConcurrentOutput: true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
var staticFiles = ['angular-tz-extensions/tz/data/*',
|
||||
'angular-scheduler/lib/angular-scheduler-detail.html',
|
||||
'angular-scheduler/lib/angular-scheduler.html',
|
||||
'nvd3/build/nv.d3.css',
|
||||
'ng-toast/dist/ngToast.min.css',
|
||||
'codemirror/addon/lint/lint.css',
|
||||
'codemirror/theme/elegant.css',
|
||||
'codemirror/lib/codemirror.css',
|
||||
'select2/dist/css/select2.css',
|
||||
'components-font-awesome/css/font-awesome.min.css',
|
||||
'components-font-awesome/fonts/fontawesome-webfont.ttf',
|
||||
'components-font-awesome/fonts/fontawesome-webfont.woff',
|
||||
'components-font-awesome/fonts/fontawesome-webfont.woff2'
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
fonts: {
|
||||
files: [{
|
||||
cwd: 'client/',
|
||||
expand: true,
|
||||
flatten: true,
|
||||
filter: 'isFile',
|
||||
src: 'assets/fontcustom/**/*',
|
||||
dest: 'static/fonts/'
|
||||
}]
|
||||
},
|
||||
icons: {
|
||||
files: [{
|
||||
cwd: 'node_modules/',
|
||||
expand: true,
|
||||
flatten: true,
|
||||
filter: 'isFile',
|
||||
src: 'components-font-awesome/fonts/*',
|
||||
dest: 'static/fonts/'
|
||||
}]
|
||||
},
|
||||
images: {
|
||||
files: [{
|
||||
cwd: 'client/',
|
||||
expand: true,
|
||||
flatten: true,
|
||||
filter: 'isFile',
|
||||
src: 'assets/custom-theme/images.new/*',
|
||||
dest: 'static/images/'
|
||||
}]
|
||||
},
|
||||
assets: {
|
||||
files: [{
|
||||
cwd: 'client/',
|
||||
expand: true,
|
||||
src: 'assets/**/*',
|
||||
dest: 'static/'
|
||||
}]
|
||||
},
|
||||
vendor: {
|
||||
files: [{
|
||||
expand: true,
|
||||
cwd: 'node_modules/',
|
||||
src: staticFiles,
|
||||
dest: 'static/lib/'
|
||||
}]
|
||||
},
|
||||
views: {
|
||||
files: [{
|
||||
cwd: 'client/features',
|
||||
expand: true,
|
||||
src: ['**/*.view.html'],
|
||||
dest: 'static/views/'
|
||||
}]
|
||||
},
|
||||
partials: {
|
||||
files: [{
|
||||
cwd: 'client/src',
|
||||
expand: true,
|
||||
src: ['**/*.partial.html'],
|
||||
dest: 'static/partials'
|
||||
}, {
|
||||
cwd: 'client/src/partials',
|
||||
expand: true,
|
||||
src: ['*.html'],
|
||||
dest: 'static/partials/'
|
||||
}, {
|
||||
cwd: 'client/lib/components',
|
||||
expand: true,
|
||||
src: ['**/*.partial.html'],
|
||||
dest: 'static/partials/components/'
|
||||
}]
|
||||
},
|
||||
languages: {
|
||||
files: [{
|
||||
cwd: 'client/',
|
||||
expand: true,
|
||||
src: 'languages/*.json',
|
||||
dest: 'static/'
|
||||
}]
|
||||
},
|
||||
config: {
|
||||
files: { 'static/config.js': ['client/src/config.js'] }
|
||||
}
|
||||
};
|
||||
@@ -1,22 +0,0 @@
|
||||
module.exports = {
|
||||
vendor: {
|
||||
files: [
|
||||
{
|
||||
expand: true,
|
||||
src: 'static/css/app.vendor.css',
|
||||
dest: '.',
|
||||
ext: '.vendor.css'
|
||||
}
|
||||
]
|
||||
},
|
||||
source: {
|
||||
files: [
|
||||
{
|
||||
expand: true,
|
||||
src: 'static/css/app.css',
|
||||
dest: '.',
|
||||
ext: '.css'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
var AutoPrefixer = require('less-plugin-autoprefix');
|
||||
|
||||
var autoPrefixer = new AutoPrefixer({
|
||||
browsers: [ 'last 2 versions' ]
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
dev: {
|
||||
files: {
|
||||
'static/css/app.css': 'client/lib/theme/index.less'
|
||||
},
|
||||
options: {
|
||||
sourceMap: true,
|
||||
plugins: [ autoPrefixer ]
|
||||
}
|
||||
},
|
||||
prod: {
|
||||
files: {
|
||||
'static/css/app.css': 'client/lib/theme/index.less'
|
||||
},
|
||||
options: {
|
||||
compress: true,
|
||||
sourceMap: false,
|
||||
plugins: [ autoPrefixer ]
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -3,13 +3,14 @@ module.exports = {
|
||||
options: {
|
||||
format: 'json'
|
||||
},
|
||||
files: [ {
|
||||
files: [{
|
||||
expand: true,
|
||||
dot: true,
|
||||
dest: 'client/languages',
|
||||
cwd: 'po',
|
||||
ext: '.json',
|
||||
src: ['*.po']
|
||||
} ]
|
||||
dot: true,
|
||||
dest: 'client/languages',
|
||||
cwd: 'po',
|
||||
ext: '.json',
|
||||
src: ['*.po']
|
||||
}]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
module.exports = {
|
||||
css: {
|
||||
files: 'client/**/*.less',
|
||||
tasks: ['less:dev']
|
||||
},
|
||||
partials: {
|
||||
files: [
|
||||
'client/lib/components/**/*.partial.html',
|
||||
'client/src/**/*.partial.html',
|
||||
'client/src/partials/*.html'
|
||||
],
|
||||
tasks: ['newer:copy:partials']
|
||||
},
|
||||
views: {
|
||||
files: 'client/features/**/*.view.html',
|
||||
tasks: ['newer:copy:views']
|
||||
},
|
||||
assets: {
|
||||
files: 'client/assets',
|
||||
tasks: ['newer:copy:assets']
|
||||
},
|
||||
config: {
|
||||
files: 'client/src/config.js',
|
||||
tasks: ['newer:copy:config']
|
||||
}
|
||||
};
|
||||
@@ -1,5 +0,0 @@
|
||||
var config = require('../webpack.config.js');
|
||||
module.exports = {
|
||||
dev: config.dev,
|
||||
prod: config.release
|
||||
};
|
||||
Reference in New Issue
Block a user