Skip to content

Commit

Permalink
Make Webpack loader detection regex dramatically faster
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Nov 1, 2021
1 parent e0440dc commit 71c75cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/resolvers/default/src/DefaultResolver.js
Expand Up @@ -5,7 +5,7 @@ import NodeResolver from '@parcel/node-resolver-core';

// Throw user friendly errors on special webpack loader syntax
// ex. `imports-loader?$=jquery!./example.js`
const WEBPACK_IMPORT_REGEX = /\S+-loader\S*!\S+/g;
const WEBPACK_IMPORT_REGEX = /^\w+-loader(?:\?\S*)?!/;

export default (new Resolver({
resolve({dependency, options, specifier}) {
Expand Down

0 comments on commit 71c75cb

Please sign in to comment.