Commit 544be28b authored by Kevin Abel's avatar Kevin Abel
Browse files

Add grunt config for building embed scripts

parent b4778891
......@@ -52,13 +52,13 @@ module.exports = function (grunt) {
less: {
all: {
options: {
paths: [lessDir],
plugins: [
autoprefixPlugin,
paths: [lessDir],
plugins: [
autoprefixPlugin,
cleanCssPlugin
]
},
files: lessFiles
]
},
files: lessFiles
}
},
uglify: {
......@@ -69,20 +69,49 @@ module.exports = function (grunt) {
files: builtJsFiles
}
},
requirejs: {
all: {
options: {
appDir: 'www/js/embed-src/',
baseUrl: './',
dir: 'www/js/embed/',
optimize: 'uglify2',
logLevel: 2,
preserveLicenseComments: false,
generateSourceMaps: true,
paths: {
'requireLib': 'require'
},
map: {
"*": {
css: 'require-css/css'
}
},
modules: [
{
name: 'all',
create: true,
include: ['requireLib', 'require-css/css', 'main', 'jquery', 'analytics'],
exclude: ['require-css/normalize']
}
]
}
}
},
clean: {
css: Object.keys(lessFiles).concat(lessVendorDir),
js: Object.keys(builtJsFiles).concat(jsDir + '/**/*.map')
},
watch: {
less: {
files: lessDir + '/**/*.less',
tasks: ['less']
}
files: lessDir + '/**/*.less',
tasks: ['less']
}
}
});
// establish grunt default
var defaultTasks = ['less', 'uglify'];
var defaultTasks = ['less', 'uglify', 'requirejs'];
var localTasks = defaultTasks.slice();
if (!allMixinsExist) {
defaultTasks.unshift('curl-dir');
......
/*.map
/search.min.js
/embed
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment