webpack-require-loader icon indicating copy to clipboard operation
webpack-require-loader copied to clipboard

Extra import

Open apastuhov opened this issue 6 years ago • 1 comments

In my stylus file I have next line:

// @require "./**/!(_index).styl";

Issue is that all stylus files were imported three times in a row.

In source files there is such code:

//...
  var regJS = /\s*\/\/\s*@(require|require-loader)*\s+(["'](.*)["']).*/mg;
  var regCSS = /\s*@(require|require-loader)*\s+(["'](.*)["']).*/mg;
//...
  while ((url = regJS.exec(source)) !== null || (url = regCSS.exec(source)) !== null) {
//...
  1. while expression was hard to debug.
  2. regCSS is a part of regJS and difference is only "//" slashes in the start of JS expression

It can be fixed via replacement of // @require with @require-loader

But it was confusing, do you need that regJS expression?

apastuhov avatar Apr 16 '18 16:04 apastuhov

Hi, @apastuhov Thank you for your issue.

I'll see next week what's there and how. I have not opened this repository for a long time, I did not think that someone is using it)

If you have any suggestions how to do better and time to do it, open pull request, I'll look with pleasure.

If it's okay, we'll merge it and publish in npm.

shanhaichik avatar Apr 19 '18 10:04 shanhaichik