Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

rollup-plugin-ignore-import

1.3.2 • Public • Published
travis build license npm version

rollup-plugin-ignore-import

Ignore import depending on the file extension. Useful when running

Installation

Via Yarn

yarn add rollup-plugin-ignore-import --save-dev

Via NPM

npm install rollup-plugin-ignore-import --save-dev

Usage

Using extensions

// rollup.config.js
import ignoreImport from 'rollup-plugin-ignore-import';
 
export default {
  entry: 'entry.js',
  dest: 'bundle.js',
  plugins: [
    ignoreImport({
      // Ignore all .scss and .css file imports while building the bundle
      extensions: ['.scss', '.css'],
      // Optional: replace body for ignored files. Default value is "export default undefined;"
      body: 'export default undefined;'
    })
  ]
}

Using include

// rollup.config.js
import ignoreImport from 'rollup-plugin-ignore-import';
 
export default {
  entry: 'entry.js',
  dest: 'bundle.js',
  plugins: [
    ignoreImport({
      // Ignore all .scss and .css file imports while building the bundle
      include: ['**/*.scss', '**/*.css'],
      // Optional: replace body for ignored files. Default value is "export default undefined;"
      body: 'export default undefined;'
    })
  ]
}

License

This software is licensed under the MIT License

Install

npm i rollup-plugin-ignore-import

DownloadsWeekly Downloads

502

Version

1.3.2

License

MIT

Unpacked Size

9.23 kB

Total Files

8

Last publish

Collaborators

  • avatar