Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deps): declare required deps for webpack build (#8411)
When using Prebid.js as a NPM dependency and built with webpack, the instructions are to use the babel configuration and plugins that are provided by Prebid. ``` { test: /.js$/, include: new RegExp(`\\${path.sep}prebid\\.js`), use: { loader: 'babel-loader', // presets and plugins for Prebid.js must be manually specified separate from your other babel rule. // this can be accomplished by requiring prebid's .babelrc.js file (requires Babel 7 and Node v8.9.0+) // as of Prebid 6, babelrc.js only targets modern browsers. One can change the targets and build for // older browsers if they prefer, but integration tests on ie11 were removed in Prebid.js 6.0 options: require('prebid.js/.babelrc.js') } } ``` This seems to work just fine when using NPM or Yarn 1. However it is not possible when using stricter settings or package managers that require strict dependency declarations. ``` [webpack-cli] Failed to load '/Users/john.wright/Workspace/mung-app/webpack.config.js' config [webpack-cli] Error: prebid.js tried to access @babel/preset-env, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. ```
- Loading branch information