meshviewer/tasks/build.js

147 lines
3.1 KiB
JavaScript
Raw Normal View History

module.exports = function exports(grunt) {
'use strict';
2016-05-27 21:59:01 +00:00
2015-03-29 12:43:02 +00:00
grunt.config.merge({
nodedir: 'node_modules',
2015-03-29 12:43:02 +00:00
copy: {
html: {
src: ['*.html'],
2015-03-29 12:43:02 +00:00
expand: true,
cwd: 'html/',
dest: 'build/'
2015-03-29 12:43:02 +00:00
},
vendorjs: {
src: ['promise-polyfill/promise.js'],
2015-03-29 12:43:02 +00:00
expand: true,
cwd: '<%=nodedir%>/',
dest: 'build/vendor/'
2015-03-29 12:43:02 +00:00
},
2016-06-01 20:20:14 +00:00
config: {
src: ['config.json'],
2016-06-01 20:20:14 +00:00
expand: true,
cwd: '.',
dest: 'build/'
2016-06-01 20:20:14 +00:00
},
ionicons: {
src: ['fonts/*'],
2015-04-04 16:01:57 +00:00
expand: true,
dest: 'build/',
cwd: 'assets/icons/'
2015-04-04 16:01:57 +00:00
},
assistantFont: {
src: ['fonts/*'],
2015-03-29 12:43:02 +00:00
expand: true,
dest: 'build/',
cwd: 'assets/'
2015-03-29 12:43:02 +00:00
}
},
2015-03-31 13:38:21 +00:00
sass: {
dev: {
2016-06-16 18:35:09 +00:00
options: {
sourceMap: true,
outputStyle: 'expanded'
2016-06-16 18:35:09 +00:00
},
files: {
'build/style.css': 'scss/main.scss',
'build/night.css': 'scss/night.scss'
}
},
2015-03-31 13:38:21 +00:00
dist: {
options: {
outputStyle: 'compressed'
},
2015-03-31 13:38:21 +00:00
files: {
'build/style.css': 'scss/main.scss',
'build/night.css': 'scss/night.scss'
2015-03-31 13:38:21 +00:00
}
}
},
postcss: {
options: {
map: false,
processors: [
require('autoprefixer')({
browsers: ['> 1% in DE']
})
]
},
dist: {
src: 'build/*.css'
}
},
inline: {
dist: {
options: {
cssmin: true,
uglify: true
},
src: 'build/index.html',
dest: 'build/index.html'
}
},
2016-06-16 18:35:09 +00:00
htmlmin: {
dist: {
options: {
removeComments: true,
collapseWhitespace: true,
minifyJS: true
},
files: {
'build/index.html': 'build/index.html'
}
}
},
2016-06-01 20:20:14 +00:00
inlinedata: {
injs: {
expand: true,
cwd: '.',
src: ['build/*.html'],
ext: '.html'
2016-06-01 20:20:14 +00:00
}
},
2015-03-29 12:43:02 +00:00
requirejs: {
default: {
2015-03-29 12:43:02 +00:00
options: {
baseUrl: 'lib',
name: '../<%=nodedir%>/almond/almond',
mainConfigFile: 'app.js',
include: '../app',
out: 'build/app.js',
2016-05-23 07:30:19 +00:00
build: true
}
},
dev: {
options: {
baseUrl: 'lib',
name: '../<%=nodedir%>/almond/almond',
mainConfigFile: 'app.js',
include: '../app',
optimize: 'none',
out: 'build/app.js',
build: false,
generateSourceMaps: true
2015-03-29 12:43:02 +00:00
}
}
2016-05-29 16:22:06 +00:00
},
cachebreaker: {
default: {
options: {
match: ['app.js']
2016-05-29 16:22:06 +00:00
},
files: {
src: ['build/index.html']
2016-05-29 16:22:06 +00:00
}
}
2015-03-29 12:43:02 +00:00
}
});
2015-03-29 12:43:02 +00:00
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks('grunt-inline');
grunt.loadNpmTasks('grunt-inline-data');
2016-06-16 18:35:09 +00:00
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-cache-breaker');
};