| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- const webpackConfig = require("./webpack.config");
- module.exports = function (grunt) {
- // Project configuration.
- grunt.initConfig({
- pkg: grunt.file.readJSON("package.json"),
- clean: ["dist"],
- bump: {
- options: {
- files: ["package.json", "bower.json", "composer.json"],
- updateConfigs: ["pkg"],
- commit: false,
- createTag: false,
- push: false,
- prereleaseName: "beta"
- }
- },
- release: {
- options: {
- bump: false,
- commit: false,
- add: false
- }
- },
- nugetpack: {
- dist: {
- src: (function () {
- return "nuspecs/Inputmask.nuspec";
- })(),
- dest: "build/",
- options: {
- version: "<%= pkg.version %>"
- }
- },
- dist2: {
- src: (function () {
- return "nuspecs/jquery.inputmask.nuspec";
- })(),
- dest: "build/",
- options: {
- version: "<%= pkg.version %>"
- }
- }
- },
- nugetpush: {
- dist: {
- src: "build/InputMask.<%= pkg.version %>.nupkg",
- options: {
- source: "https://www.nuget.org"
- }
- },
- dist2: {
- src: "build/jquery.inputMask.<%= pkg.version %>.nupkg",
- options: {
- source: "https://www.nuget.org"
- }
- }
- },
- karma: {
- options: {
- configFile: "karma.conf.js"
- },
- unit: {
- singleRun: true
- }
- },
- eslint: {
- target: "lib/*.js"
- },
- availabletasks: {
- tasks: {
- options: {
- filter: "exclude",
- tasks: ["availabletasks", "default"],
- showTasks: ["user"]
- }
- }
- },
- webpack: {
- main: webpackConfig("production")[0],
- jquery: webpackConfig("production")[1],
- colormask: webpackConfig("production")[2]
- },
- copy: {
- extensions: {
- files: [
- {
- src: "lib/bindings/inputmask.binding.js",
- dest: "dist/bindings/inputmask.binding.js"
- },
- {
- src: "lib/bindings/inputmask.es6.js",
- dest: "dist/inputmask.es6.js"
- },
- { src: "lib/extensions/colormask.css", dest: "dist/colormask.css" },
- {
- src: "Changelog.md",
- dest: "inputmask-pages/src/assets/Changelog.md"
- }
- ]
- }
- }
- });
- // Load the plugin that provides the tasks.
- require("load-grunt-tasks")(grunt);
- grunt.registerTask("publish", ["release", "nugetpack", "nugetpush"]);
- grunt.registerTask("publishnext", function () {
- grunt.config("release.options.npmtag", "next");
- grunt.task.run("release");
- });
- grunt.registerTask("validate", ["webpack", "copy", "eslint", "karma"]);
- grunt.registerTask("build", ["bump:prerelease", "clean", "webpack", "copy"]);
- grunt.registerTask("build:patch", ["bump:patch", "clean", "webpack", "copy"]);
- grunt.registerTask("build:minor", ["bump:minor", "clean", "webpack", "copy"]);
- grunt.registerTask("build:major", ["bump:major", "clean", "webpack", "copy"]);
- grunt.registerTask("default", ["availabletasks"]);
- };
|