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

Issue with minified js file #596

Open
brambuz opened this issue Apr 7, 2023 · 1 comment
Open

Issue with minified js file #596

brambuz opened this issue Apr 7, 2023 · 1 comment
Labels

Comments

@brambuz
Copy link

brambuz commented Apr 7, 2023

Describe the bug
I have a JS file with "$(document).ready(function ()" and other functions, bundleconfig.json is:

....
  {
    "outputFileName": "wwwroot/bundles/Scripts/Shared/header.min.js",
    "inputFiles": [
      "wwwroot/Scripts/Shared/_header.js"
    ],
    "minify": {
      "enabled": true,
      "renameLocals": true
    },
    "sourceMap": false
  }
.... 

but in the output file missing all "$(document).ready(function ()" file start with first function (see screenshot)

Visual Studio Community 2022 Version 17.5.3
Bundler and Minifier ver 2.9.9

Expected behavior
min file with all part of original js file

Screenshots
original file JS:

full

min file:

min_issue

thank you for your help

@brambuz brambuz added the bug label Apr 7, 2023
@pitus
Copy link

pitus commented Aug 1, 2023

Can you post the minified source code?
I suspect that your $(document).ready(function () ... ) was optimized into a shorthand version like $($ => ...) or $(function($)...) so your search fails.
See https://stackoverflow.com/questions/6004129/document-ready-shorthand

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

No branches or pull requests

2 participants