Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
How to pass loader options with Resolve.Alias

I want to pass options to 'raw-loader' while using alias since the use of loader ['base64-inline-loader' or 'raw-loader'] will be conditional for *.csv

if(condition) {
   require('raw-loader!files/file_name.csv'); //I want to add this "options: { esModule: false }"
} else {
   require('base64-inline-loader!files/file_name.csv');
}

Aliases, I want to add this "options: { esModule: false }" to 'raw-loader' alias.

resolve: {
    alias: {
      'base64-inline-loader': "base64-inline-loader",
      'raw-loader': "raw-loader"
    }
  }

Rules that are used for .csv if not calling with alias:

  module: {
    rules: [
        { /*Runs as default when not using alias*/
          test: /\.csv$/i,
          use: ['base64-inline-loader']
      },
      {
        test: /\.csv$/i,
        use: [
          {
            loader: 'raw-loader',
            options: {
              esModule: false,
            },
          },
        ],
      }]
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!