Socket
Socket
Sign inDemoInstall

babili-webpack-plugin

Package Overview
Dependencies
83
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.8 to 0.0.9

12

lib/index.js

@@ -16,6 +16,8 @@ "use strict";

function BabiliPlugin() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var babiliOpts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
_classCallCheck(this, BabiliPlugin);
this.babiliOpts = babiliOpts;
this.options = options;

@@ -27,6 +29,8 @@ }

value: function apply(compiler) {
var options = this.options;
var babiliOpts = this.babiliOpts,
options = this.options;
var jsregex = options.test || /\.js($|\?)/i;
var commentsRegex = typeof options.comments === "undefined" ? /@preserve|@license/ : options.comments;
var commentsRegex = typeof options.comments === "undefined" ? /@preserve|@licen(s|c)e/ : options.comments;

@@ -87,3 +91,3 @@ var useSourceMap = typeof options.sourceMap === "undefined" ? !!compiler.options.devtool : options.sourceMap;

var result = _babel.transform(input, {
presets: [_babili],
presets: [[_babili, babiliOpts]],
sourceMaps: useSourceMap,

@@ -90,0 +94,0 @@ babelrc: false,

{
"name": "babili-webpack-plugin",
"version": "0.0.8",
"version": "0.0.9",
"description": "Babili Plugin for Webpack",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -29,3 +29,3 @@ # babili-webpack-plugin

plugins: [
new BabiliPlugin(options)
new BabiliPlugin(babiliOptions, overrides)
]

@@ -37,2 +37,8 @@ }

#### babiliOptions
babiliOptions are passed along to the babili preset. Check https://github.com/babel/babili/tree/master/packages/babel-preset-babili#options. `Default: {}`.
#### Overrides
+ `test`: JS file extension regex. Default: `/\.js($|\?)/i`

@@ -39,0 +45,0 @@ + `comments`: Preserve Comments. Default: `/@preserve|@licen(s|c)e/`. falsy value to remove all comments. Accepts function, object with property test (regex), and values.

@@ -8,3 +8,4 @@ "use strict";

module.exports = class BabiliPlugin {
constructor(options = {}) {
constructor(babiliOpts = {}, options = {}) {
this.babiliOpts = babiliOpts;
this.options = options;

@@ -14,3 +15,3 @@ }

apply(compiler) {
const options = this.options;
const {babiliOpts, options} = this;

@@ -73,3 +74,3 @@ const jsregex = options.test || /\.js($|\?)/i;

const result = _babel.transform(input, {
presets: [_babili],
presets: [[_babili, babiliOpts]],
sourceMaps: useSourceMap,

@@ -76,0 +77,0 @@ babelrc: false,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc