Skip to content

Commit 8415a8c

Browse files
johngeorgewrightrenebaudisch
authored andcommitted
fix(deps): declare required deps for webpack build (prebid#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. ```
1 parent 1f7dcc7 commit 8415a8c

File tree

2 files changed

+60
-384
lines changed

2 files changed

+60
-384
lines changed

0 commit comments

Comments
 (0)