// Remove the webpack-dev-server grunt task since we do not use it
var fs = require('fs');
var path = require('path');

var taskFile = path.join(__dirname, '..', 'node_modules', 'grunt-webpack', 'tasks', 'webpack-dev-server.js');

if (fs.existsSync(taskFile)) {
    console.log('Removing unused task file ' + taskFile);
    fs.unlinkSync(taskFile);
}

// Remove the webpack-dev-server grunt task since we do not use it

var fs = require('fs');
var taskFile = null;

try {
    taskFile = require.resolve('grunt-webpack/tasks/webpack-dev-server.js');
} catch(e) {}

if (taskFile) {
    console.log('Removing unused task file ' + taskFile);
    fs.unlinkSync(taskFile);
}

Use require.resolve for more robust path lookup
Use require.resolve for more robust path lookup
