166 lines
6.0 KiB
JavaScript
166 lines
6.0 KiB
JavaScript
/* global require, module */
|
|
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
|
const Funnel = require('broccoli-funnel');
|
|
// Babel transpiler
|
|
const BabelTranspiler = require('broccoli-babel-transpiler');
|
|
|
|
module.exports = function(defaults) {
|
|
const app = new EmberApp(defaults, {
|
|
'ember-cli-babel': {
|
|
includePolyfill: true
|
|
},
|
|
sourcemaps: {
|
|
enabled: EmberApp.env() !== 'production',
|
|
extensions: ['js', 'coffee']
|
|
},
|
|
outputPaths: {
|
|
app: {
|
|
html: 'index.html',
|
|
css: {
|
|
app: '/assets/css/main.css'
|
|
},
|
|
js: '/assets/js/main.js'
|
|
},
|
|
// only emberjs core
|
|
vendor: {
|
|
css: '/assets/css/emberjs.css',
|
|
js: '/assets/js/emberjs.js'
|
|
}
|
|
}
|
|
});
|
|
|
|
// Use `app.import` to add additional libraries to the generated
|
|
// output files.
|
|
//
|
|
// If you need to use different assets in different
|
|
// environments, specify an object as the first parameter. That
|
|
// object's keys should be the environment name and the values
|
|
// should be the asset to use in that environment.
|
|
//
|
|
// If the library that you are including contains AMD or ES6
|
|
// modules that you would like to import into your application
|
|
// please specify an object with the list of modules as keys
|
|
// along with the exports of each module as its value.
|
|
|
|
function importVendor(app, resource, outputFile) {
|
|
if (/\.js$/.test(resource)) {
|
|
app.import(resource, { outputFile: outputFile || 'assets/js/vendor.js'});
|
|
}
|
|
else if (/\.css$/.test(resource)) {
|
|
app.import(resource, { outputFile: outputFile || 'assets/css/vendor.css'});
|
|
}
|
|
}
|
|
|
|
importVendor(app, 'bower_components/bootstrap/dist/css/bootstrap.css');
|
|
// importVendor(app, 'bower_components/bootstrap/dist/css/bootstrap-theme.css');
|
|
importVendor(app, 'bower_components/bootstrap/dist/js/bootstrap.js');
|
|
let bootstrapAssets = new Funnel('bower_components/bootstrap/dist/fonts', {
|
|
include: ['*.*'],
|
|
destDir: '/assets/fonts'
|
|
});
|
|
|
|
importVendor(app, 'bower_components/bootbox/bootbox.js');
|
|
importVendor(app, 'bower_components/validate/validate.js');
|
|
|
|
// FueUX
|
|
importVendor(app, 'bower_components/fuelux/js/spinbox.js');
|
|
importVendor(app, 'bower_components/fuelux/js/tree.js');
|
|
|
|
// for image previews
|
|
importVendor(app, 'bower_components/jquery-colorbox/jquery.colorbox-min.js');
|
|
importVendor(app, 'bower_components/jquery-colorbox/example1/colorbox.css');
|
|
let jqColorboxAssets = new Funnel('bower_components/jquery-colorbox/example1/images', {
|
|
include: ['*.*'],
|
|
destDir: '/assets/css/images'
|
|
});
|
|
|
|
// font awesome
|
|
importVendor(app, 'bower_components/font-awesome/css/font-awesome.min.css');
|
|
let faAssets = new Funnel('bower_components/font-awesome/fonts', {
|
|
include: ['*.*'],
|
|
destDir: '/assets/fonts'
|
|
});
|
|
|
|
// bootstrap color picker
|
|
importVendor(app, 'bower_components/mjolnic-bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css');
|
|
importVendor(app, 'bower_components/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js');
|
|
let bcpAssets = new Funnel('bower_components/mjolnic-bootstrap-colorpicker/dist/img', {
|
|
include: ['bootstrap-colorpicker/*.*'],
|
|
destDir: '/assets/img'
|
|
});
|
|
|
|
// JQuery HotKeys
|
|
importVendor(app, 'bower_components/jquery.hotkeys/jquery.hotkeys.js');
|
|
// Bootstrap WYSIWYG
|
|
importVendor(app, 'bower_components/bootstrap-wysiwyg/bootstrap-wysiwyg.js');
|
|
|
|
// Select2, must before ace
|
|
importVendor(app, 'vendor/ace/js/select2.js');
|
|
importVendor(app, 'vendor/ace/css/select2.css');
|
|
|
|
let select2Images = new Funnel('vendor/ace/css', {
|
|
include: ['select2-spinner.gif', 'select2.png', 'select2x2.png'],
|
|
destDir: '/assets/css'
|
|
});
|
|
|
|
// ACE CSS
|
|
importVendor(app, 'vendor/ace/css/ace.css');
|
|
importVendor(app, 'vendor/ace/css/ace-fonts.css');
|
|
let aceFonts = new Funnel('vendor/ace/fonts', {
|
|
include: ['*.*'],
|
|
destDir: '/assets/fonts'
|
|
});
|
|
let aceImages = new Funnel('vendor/ace/css/images', {
|
|
include: ['**/*.*'],
|
|
destDir: '/assets/css/images'
|
|
});
|
|
|
|
// ACE JS
|
|
// start up
|
|
importVendor(app, 'vendor/ace/js/ace/ace.js');
|
|
importVendor(app, 'vendor/ace/js/ace-extra.js');
|
|
importVendor(app, 'vendor/ace/js/ace-elements.js');
|
|
|
|
// importVendor(app, 'vendor/ace/js/ace/elements.fileinput.js');
|
|
// importVendor(app, 'vendor/ace/js/ace/elements.spinner.js');
|
|
// importVendor(app, 'vendor/ace/js/ace/elements.treeview.js');
|
|
importVendor(app, 'vendor/ace/js/ace/elements.wysiwyg.js');
|
|
|
|
// importVendor(app, 'vendor/ace/js/jquery-ui.custom.js');
|
|
|
|
importVendor(app, 'vendor/ace/js/ace/ace.touch-drag.js');
|
|
|
|
importVendor(app, 'vendor/ace/js/ace/ace.sidebar.js');
|
|
importVendor(app, 'vendor/ace/js/ace/ace.sidebar-scroll-1.js');
|
|
importVendor(app, 'vendor/ace/js/ace/ace.submenu-hover.js');
|
|
|
|
importVendor(app, 'vendor/ace/js/ace/ace.settings.js');
|
|
importVendor(app, 'vendor/ace/js/ace/ace.settings-rtl.js');
|
|
importVendor(app, 'vendor/ace/js/ace/ace.settings-skin.js');
|
|
|
|
importVendor(app, 'vendor/ace/js/ace/ace.widget-box.js');
|
|
importVendor(app, 'vendor/ace/js/ace/ace.widget-on-reload.js');
|
|
importVendor(app, 'vendor/ace/js/ace/ace.searchbox-autocomplete.js');
|
|
|
|
// JQuery Qr Code
|
|
importVendor(app, 'vendor/jquery-qrcode/js/jquery-qrcode.js');
|
|
// JQuery Hot Keys
|
|
importVendor(app, 'vendor/jquery-hotkeys/js/jquery.hotkeys.min.js');
|
|
|
|
// compile public es6
|
|
const publicJs = BabelTranspiler('public', {
|
|
browserPolyfill: true,
|
|
filterExtensions: ['js']
|
|
});
|
|
|
|
return app.toTree([bootstrapAssets,
|
|
jqColorboxAssets,
|
|
faAssets,
|
|
bcpAssets,
|
|
aceFonts,
|
|
aceImages,
|
|
select2Images,
|
|
publicJs
|
|
]);
|
|
};
|