lundi 28 mai 2018

Webpack - how to use loader for file ending with given string?

I have some files called:

core.service.js
second.service.js

And I'm loading them like this:

rules: [
{
  test: /\.service\.js$/,
  use: { loader: 'service-loader' }
}

I want to rename these files to:

coreService.js
secondService.js

How should I update my "test" rule to load these? I've been trying something like:

test: /\service\.js$/,

but it's not working.

Aucun commentaire:

Enregistrer un commentaire