Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand globs #52

Closed
gaearon opened this issue Jun 28, 2017 · 6 comments
Closed

Expand globs #52

gaearon opened this issue Jun 28, 2017 · 6 comments

Comments

@gaearon
Copy link

gaearon commented Jun 28, 2017

Currently it seems like the program doesn't expand globs itself. This makes it impossible to run something like source-map-explorer build/static/js/main.* on Windows and get it to pick up a hashed filename. Which makes it hard to put into package.json as one of the scripts because the built filename is different every time.

It would be great if source-map-explorer could expand globs (it's fine to enforce it only expands to a single file) for this particular use case on Windows.

@danvk
Copy link
Owner

danvk commented Jun 28, 2017

Hi @gaearon! What would you expect the output of source-map-explorer to be with a glob input? Are you expecting build/static/js/main.* to expand to build/static/js/main.js build/static/js/main.js.map or to include multiple bundles? If it's the former, I'm surprised that your shell isn't handling this.

@gaearon
Copy link
Author

gaearon commented Jun 28, 2017

The goal is to match main.js.somelongrandomhash.js and main.js.somelongrandomhash.js.map. The hash is different on every build.

Windows shells don't have any expansion at all. They just pass what you typed.

@danvk
Copy link
Owner

danvk commented Jun 28, 2017

Makes sense. I'd happily merge a PR to do this, or I can take a crack at it myself soon.

@gaearon
Copy link
Author

gaearon commented Jun 28, 2017

Awesome! I probably won't have time to dive into it but if you can't find time either, let me know and I can create an issue in create-react-app asking someone to contribute this. Since we now link to this tool from the documentation.

@danvk
Copy link
Owner

danvk commented Jul 3, 2017

@gaearon I merged a fix for this and cut a 1.4.0 release. Let me know if this works for you.

@arve0
Copy link
Contributor

arve0 commented Jan 11, 2019

Has anything changed in 1.6.0? Cannot get globs to work:

C:\Temp\sme>npm i -g source-map-explorer
C:\Users\_\AppData\Roaming\npm\source-map-explorer -> C:\Users\_\AppDa
ta\Roaming\npm\node_modules\source-map-explorer\index.js
+ source-map-explorer@1.6.0
updated 1 package in 0.957s

C:\Temp\sme>source-map-explorer --version
1.6.0

C:\Temp\sme>source-map-explorer main.*
File not found! --  ENOENT: no such file or directory, open 'main.*'

C:\Temp\sme>dir main.*
 Volumet i stasjon C er OSDisk
 Volumserienummeret er F65B-C808

 Innhold i C:\Temp\sme

11.01.2019  08:36             2 146 main.js
               1 fil(er)            2 146 byte
               0 mappe(r)   9 305 964 544 byte ledig

C:\Temp\sme>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants