Skip to content

Commit

Permalink
Only install banner in files that are modules by default (neutrinojs#663
Browse files Browse the repository at this point in the history
)
  • Loading branch information
eliperelman authored Jan 9, 2018
1 parent 45b95cf commit ffd9b15
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions packages/banner/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
const { BannerPlugin } = require('webpack');
const merge = require('deepmerge');

module.exports = ({ config }, options = {}) => config
.plugin(options.pluginId || 'banner')
.use(BannerPlugin, [
merge({
banner: 'require(\'source-map-support\').install();',
raw: true,
entryOnly: true
}, options)
]);
module.exports = (neutrino, options = {}) => {
neutrino.config
.plugin(options.pluginId || 'banner')
.use(BannerPlugin, [
merge({
banner: 'require(\'source-map-support\').install();',
test: neutrino.regexFromExtensions(),
raw: true,
entryOnly: true
}, options)
]);
};

0 comments on commit ffd9b15

Please sign in to comment.