bower-resolve-webpack-plugin

1.0.5 • Public • Published

Bower Webpack Plugin

Use Bower with Webpack v2.

What

Enhances enhanced-resolver plugin to be able to understand bower.json description file when main field is an array. Plugin iterates over all defined libraries in the array, finds javascript file and resolves it as a module file. Keep in mind, you are still responsible to manually require any other non-javascript files associated with the bower package.

Usage

Install the plugin:

npm install bower-resolve-webpack-plugin

Add the plugin to your Webpack configuration:

  const BowerResolvePlugin = require("bower-resolve-webpack-plugin");
 
  resolve: {
    plugins: [new BowerResolvePlugin()],
    modules: ['bower_components', 'node_modules'],
    descriptionFiles: ['bower.json', 'package.json'],
    mainFields: ['browser', 'main']
  },

Caveats

This plugin has been developed to work with Webpack 2, for similar plugins that work with Webpack 1 use Bower Plugin.

About CodeWizz

CodeWizz is a web development agency based in Lithuania. You'll find more information on our website.

License

The MIT License (MIT). Please see License File for more information.

Package Sidebar

Install

npm i bower-resolve-webpack-plugin

Weekly Downloads

910

Version

1.0.5

License

MIT

Unpacked Size

5.92 kB

Total Files

4

Last publish

Collaborators

  • codewizz