how to override a library’s use of an inline loader

Viewed 178

A library I depend on (in this case, pdfjs) is using the worker loader inline via var PdfjsWorker = require('worker-loader!./build/pdf.worker.js');

I really want to configure the worker loader to just inline this worker so I can still use the webpack development server.... I have the following configuration not being matched:

    module: {
        rules: [
          {
            test: /\.worker\.js$/,
            use: { 
                loader: 'worker-loader',
                options: { inline: true }
            }
          }
        ]
      }

When I edit node_modules directly (gross) and update the line to var PdfjsWorker = require('./build/pdf.worker.js'); everything works and it is PERFECT.... is there a way to basically FORCE an option for all usages of a given loader even if the loader is being specified inline? Or a way to perhaps literally rewrite this line of code or SOMETHING I can make webpack do so I can essentially get what I want out of this?

0 Answers
Related