Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Invalid option 'babili' #45

Closed
davisford opened this issue Jun 12, 2017 · 1 comment
Closed

Invalid option 'babili' #45

davisford opened this issue Jun 12, 2017 · 1 comment

Comments

@davisford
Copy link

Hi, I've tried several ways to configure this plugin -- I either hit the Out Of Memory Issue with Babili itself (using all default options), or when I do try to pass options, I consistently get some error about an option property I thought was valid, and it doesn't minify or mangle anything.

Here's example output showing the latter:

 [372] ./bo/forms/payments.js 21.9 kB {0} [built]
 [414] ./pos.css 1.02 kB {1} [built]
 [555] ./boindex.js 6.28 kB {0} [built]
 [589] ./posindex.js 2.15 kB {1} [built]
    + 637 hidden modules

ERROR in Invalid option "presets"

ERROR in Invalid option "presets"

ERROR in Invalid option "presets"

ERROR in Invalid option "presets"

I've scoured github issues trying to find the correct way to configure the plugin. I must be missing something with the babili-preset-options project.

When I try to pass in some simple preset options, no matter what construction I make, it errors out and won't minify, etc.

config.plugins.push(new BabiliPlugin({
            "presets": [["babili", {
            "evaluate": false,
            "mangle": true
          }]]
        
      }, {
        test: /\.js$/i,
        comments: false,
        sourceMap: true
      }));

Could someone advise on the correct way to configure this plugin?

@boopathi
Copy link
Member

The format is

config.plugins.push(new BabiliPlugin({
  mangle: true,
  evaluate: true,
  // and all options that you'd pass to the preset
}, {
  test: /\.js$/i,
  comments: false,
  sourceMap: true
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants