brunch / deppack

Extract node modules to browser.
MIT License
4 stars 13 forks source link

error when processing .js file that has .json substring #53

Open jiixing opened 3 years ago

jiixing commented 3 years ago

Found a bug when including core-js package in brunch

This package has two files with .json substring in it

https://github.com/zloirock/core-js/blob/ae33634b34/packages/core-js/modules/es.json.stringify.js https://github.com/zloirock/core-js/blob/ae33634b34/packages/core-js/modules/es.json.to-string-tag.js

The code in https://github.com/brunch/deppack/blob/bef509bedbf3d737747e2c4ec96db1c0baa866ee/lib/modules.js#L185 should be changed to

  if (filePath.endsWith('.json') === false) {