overexchange
overexchange

Reputation: 1

npm install - how to avoid bowercopy dependency? And install dependencies using webpack

bowercopy is a deprecated tool for newer projects

Below task(from here) is the grunt task using bowercopy tool as dependency:

var JS_VENDOR_PATH = 'public/js/vendor',
    CSS_VENDOR_PATH = 'public/css/vendor';

module.exports = function(grunt) {

  grunt.loadNpmTasks('grunt-bowercopy');
  grunt.loadNpmTasks('grunt-contrib-clean');

  grunt.initConfig({
    clean: {
      'vendor-js': JS_VENDOR_PATH,
      'vendor-css': CSS_VENDOR_PATH
    },

    bowercopy: {
        options: {
        },
        js: {
          options: {
            destPrefix: JS_VENDOR_PATH
          },
          files: {
            'todomvc-common.js' : 'todomvc-common/base.js',
            'jquery.js' : 'jquery/jquery.js',
            'underscore.js' : 'underscore/underscore.js',
            'backbone.js' : 'backbone/backbone.js'
          }
        },
        css: {
          options: {
            destPrefix: CSS_VENDOR_PATH
          },
          files: {
            'todomvc-common.css':'todomvc-common/base.css'
          }
        }
      }
  });

  grunt.registerTask('default', ['clean','bowercopy']);

};

We get deprecation issues, as shown below:

$ npm install
npm WARN deprecated bower@1.8.8: We don't recommend using Bower for new projects. Please consider Yarn and Webpack or Parcel. You can read how to migrate legacy project here: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated coffee-script@1.3.3: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
audited 197 packages in 2.475s
found 29 vulnerabilities (6 low, 6 moderate, 17 high)
  run `npm audit fix` to fix them, or `npm audit` for details

Npm version is 6.11

How to remove bower & bowercopy dependency in this grunt task? And use webpack instead of grunt...

{
  "name": "xxx",
  "version": "1.0.0",
  "scripts": {
    "prepublish": "grunt",
    "build": "grunt",
    "start": "open index.html || sensible-browser index.html || xdg-open index.html"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/xxxx"
  },
  "bugs": {
    "url": "https://github.com/xxxx/issues"
  },
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-bowercopy": "^1.2.4",
    "grunt-contrib-clean": "^0.6.0"
  },
  "dependencies": {
    "express": "^4.13.3"
  }
}

Upvotes: 1

Views: 192

Answers (0)

Related Questions