Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. /* Throws:
  2. Error: WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
  3. - configuration.module.rules should be an array:
  4. [object { enforce?, exclude?, include?, issuer?, loader?, loaders?, oneOf?, options?, parser?, query?, resource?, resourceQuery?, compiler?, rules?, test?, use? }]
  5. -> Options affecting the normal modules (`NormalModuleFactory`).
  6. */
  7. export default (config, env, helpers, options) => {
  8. let loaders = JSON.parse(JSON.stringify(helpers.getLoaders(config)));
  9. let lastLoader = loaders.pop();
  10. loaders.push(lastLoader);
  11. config.module.rules = loaders.push(
  12. {
  13. test: /\.(png|woff|woff2|eot|ttf|otf|svg)$/,
  14. ruleIndex: lastLoader.ruleIndex+1,
  15. loaderIndex: lastLoader.loaderIndex+1,
  16. loader: 'url-loader?limit=100000'
  17. }
  18. )
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement