-
Notifications
You must be signed in to change notification settings - Fork 10
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
Once minified, my site is no longer working #7
Comments
If you can post a sample project with those files, I’ll try to debug it for you, I’m bundling and minimizing almost 200 files in my project, so it could be a wuirk with the library you are using; I’ll do my best to address it. |
@failwyn What would you like to see? Do you mean a working website? |
Doesn’t have to be working, I just need enough to replicate your error so that I can debug it. |
@failwyn Ok, this was a little tricky as my JavaScript was making AJAX calls but I was able to duplicate the issue without modifying the original files. In index.htm, you'll find the following block of code. <!-- Minified and bundled files -- DOES NOT WORK -->
<!-- <script src="charts.min.js"></script> -->
<!-- Unminified and bundled files -- WORK FINE -->
<script src="chart.min.js"></script>
<script src="charts.js"></script> As it stands, the code includes chart.min.js and charts.js, and there are no errors. But if you comment out those two lines and instead include the minified and bundled file charts.min.js, there are errors. The two versions should work exactly the same. |
@SoftCircuits I need to be able to replicate the issue with Bunder & Minifier so I would need the bundleconfig.json file. One thing I thought of, are you minimizing the already minimized chart.min.js file? Do you have access to chart.js? If you Bundle chart.js and charts.js, then enable minification, it will probably work. I've never tried minimizing a minimized file, but I imagine it could definitely be the source of your issue. |
@failwyn Yes, I am minimizing an already minimized file. I think this should be supported, much like zipping an already zipped file is supported. I would have to search to see if the unminified version is available. I just used the one I had. If you tell me I can't minify a minified file, then that's what I would try to do. But my opinion is that the software should handle this. Is there a way to tell bundleconfig.json to bundle files without minifying them? My bundleconfig.json is below, but only the last entry is related to the files I sent you.
|
I'm not sure that's the issue, it was just a guess, try this and see if you still get the same error; if it works, then it could be an issue with NUglify. } |
@failwyn Yes, that appears to be working. |
@failwyn Thanks for looking into. As stated previously, I think this should be supported. If it were my software, I'd make sure it handled minifying an already minified file. But now I know the issue, I'll be able to move forward. Thanks again. BTW, what are the rules about when the minified and bundled files are produced? Sometimes I make changes and they build right away. And other times it takes me considerable time to get it to rebuild them. |
Bundler & Minifier uses NUglify to minimize the files, you could try posting an issue on their GitHub repository to see if the contributors have a better answer; if they fix it, I’ll definitely upgrade the version used in the extension. It should update the bundle whenever any of the inout files are modified; I have bundles that contain over 100 input files and I’ve never had an issue with it not updating. If you can provide steps to reproduce the issue, I’d be happy to look at it. |
@failwyn Looks like it's not creating one of my files due to an error.
I probably have something wrong in my config file but haven't found it yet. UPDATE: It appears the problem is with processing the file chart.js. If I comment out that file from the bundle, it builds the output file.
|
If you can isolate the code that is causing the error I can try to fix it in NUglify |
Installed product versions
Description
Am I the only one experiencing my code not working after it's minified?
Steps to recreate
My site was working fine. Then I enabled minification and I'm getting all sorts of JavaScript errors.
It's not JavaScript that I wrote. So it might be beyond my abilities to actually debug the code so I can tell you what's missing. I was just wondering if this is a known issue. Doesn't it rearrange things in some cases? Anything you can suggest?
UPDATE:
I'm not sure if this is helpful but I'm attaching three files.
Notes:
charts.min.js:7
charts.min.js:7
JavaScript.zip
The text was updated successfully, but these errors were encountered: