Skip to content

Commit

Permalink
chore: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeanroy committed Jan 14, 2019
1 parent c6882ce commit 82c1699
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
17 changes: 1 addition & 16 deletions src/index-rollup-stable.js
Expand Up @@ -24,25 +24,10 @@

'use strict';

const _ = require('lodash');
const LicensePlugin = require('./license-plugin.js');

module.exports = (options = {}) => {
// Rollup <= 0.48 used `sourceMap` in camelcase, so this plugin used
// this convention at the beginning.
// Now, the `sourcemap` key should be used, but legacy version should still
// be able to use the `sourceMap` key.
const newOptions = _.omitBy(options, (value, key) => (
key === 'sourceMap'
));

// If the old `sourceMap` key is used, set it to `sourcemap` key.
if (!_.hasIn(newOptions, 'sourcemap') && _.hasIn(options, 'sourceMap')) {
console.warn(`[${LicensePlugin.NAME}] sourceMap has been deprecated, please use sourcemap instead.`);
newOptions.sourcemap = options.sourceMap;
}

const plugin = new LicensePlugin(newOptions);
const plugin = new LicensePlugin(options);

return {
/**
Expand Down
6 changes: 0 additions & 6 deletions src/license-plugin.js
Expand Up @@ -326,10 +326,4 @@ class LicensePlugin {
}
}

/**
* Export the plugin name as static property.
* @type {string}
*/
LicensePlugin.NAME = PLUGIN_NAME;

module.exports = LicensePlugin;

0 comments on commit 82c1699

Please sign in to comment.