Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore "Seems to be a pre-built javascript file...Try to require the original source to get better results." for Webpack?

Webpack is throwing a warning: "This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results."

However, this library I am including is intentionally pre-built such that consuming applications do not need to replicate its build steps and configuration.

How do I ignore this warning?

like image 802
ngokevin Avatar asked Sep 29 '16 10:09

ngokevin


1 Answers

Fix this by adding the path to the prebuilt module into your webpack config under module:

module: {
    // ...
    noParse: [
      '/node_modules/prebuiltlib/dist/build.js',
    ]
    // ...
}

This has the added benefit of slightly faster build times.

like image 88
ngokevin Avatar answered Oct 24 '22 11:10

ngokevin