一覧へ戻る
mjeanroy/rollup-plugin-bower-resolve(新しいタブで開きます)
主要言語: JavaScript
Use the bower resolution algorithm with Rollup
- star 数
- 8
- watcher 数
- 1
- fork 数
- 4
- issue 数
- 5
- 最終更新
- 2026/10/30
主要言語: JavaScript
Use the bower resolution algorithm with Rollup
Locate modules using the bower resolution algorithm for using third party modules in your bower component directory.
npm install --save-dev rollup-plugin-bower-resolve
import { rollup } from 'rollup'; import bowerResolve from 'rollup-plugin-bower-resolve'; rollup({ entry: 'main.js', plugins: [ bowerResolve({ // The working directory to use with bower (i.e the directory where // the `bower.json` is stored). // Default is `process.cwd()`. cwd: '/tmp', // Use `bower` offline. // Default is `true`. offline: false, // Use "module" field for ES6 module if possible, default is `true`. // See: https://github.com/rollup/rollup/wiki/pkg.module module: true, // Use "jsnext:main" field for ES6 module if possible, default is `true`. // This field should not be used, use `module` entry instead, but it is `true` // by default because of legacy packages. // See: https://github.com/rollup/rollup/wiki/jsnext:main jsnext: true, // if there's something your bundle requires that you DON'T // want to include, add it to 'skip' skip: [ 'some-big-dependency' ], // Default: [] // Override path to main file (relative to the module directory). override: { lodash: 'dist/lodash.js' } }) ] }).then( bundle => bundle.write({ dest: 'bundle.js', format: 'iife' }) );
This plugin may be used with rollup-plugin-commonjs to support non ES6 module:
import { rollup } from 'rollup'; import bowerResolve from 'rollup-plugin-bower-resolve'; import commonjs from 'rollup-plugin-commonjs'; rollup({ entry: 'main.js', plugins: [ bowerResolve(), commonjs() ] }).then(bundle => bundle.write({ dest: 'bundle.js', moduleName: 'MyModule', format: 'iife' })).catch(err => console.log(err.stack));
engines field in package.json file.engines field in package.json file.offline mode (and add options to disable offline).cwd option.module optionjsnext optionMIT