Skip to content

Instantly share code, notes, and snippets.

@jamiehowarth0
Created August 16, 2018 02:49
Show Gist options
  • Save jamiehowarth0/a8818c237484f1670f4d1a2256de4a37 to your computer and use it in GitHub Desktop.
Save jamiehowarth0/a8818c237484f1670f4d1a2256de4a37 to your computer and use it in GitHub Desktop.
Finds all the JS files in your ASP.NET project ready to then bundle them up using a tool like Webpack.
gci -Include "*.cshtml" -recurse | select -expand FullName | where { -not [string]::IsNullOrEmpty($_) } | foreach { Select-String -Path $_ -Pattern '~(.*\.js)' -AllMatches } | foreach {$_.Matches.Groups[1].Value} | Sort-Object | Get-Unique -AsString > .\alljs.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment