@narmafzam/jalali-datepicker
Version:
just a jalali-datepicker
45 lines (42 loc) • 1.26 kB
JavaScript
const webpackConfig = require('./webpack.config.js');
const webpackDevConfig = require('./webpack.config.dev.js');
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
banner: '/*\n' +
'** <%= pkg.name %> - v<%= pkg.version %>\n' +
'** <%= pkg.author %>\n' +
'** <%= pkg.homepage %>\n' +
'** Under <%= pkg.license %> license \n' +
'*/ \n',
usebanner: {
dist: {
options: {
position: 'top',
banner: '<%= banner %>'
},
files: {
src: ['dist/**/*.js', 'dist/js/<%= pkg.name %>.js']
}
}
},
pkg: grunt.file.readJSON('package.json'),
watch: {
js: {
files: ['src/es6/*.js'],
tasks: ['webpack:dev']
}
},
webpack: {
prod: webpackConfig,
dev: webpackDevConfig
}
});
if (grunt.option("dev") === true) {
grunt.registerTask('default', ['webpack:dev', 'watch']);
}
else {
grunt.registerTask('default', ['webpack', 'usebanner']);
}
};