1

Here is where i include the ScriptBundle:

bundles.Add(new ScriptBundle("~/scripts").Include(
                    "~/Scripts/jquery.js", "~/Scripts/popper.js",
                    "~/Scripts/bootstrap.js", "~/Scripts/Index.js"));

When i debbug the application the script tags are rendered separately, and it works well. The problem is when i publish the project, the scripts are rendered in a single tag; i know that AspNet compress all the scripts in a single tag, but the web page does not detect the scripts and when i click on the link of the rendered tag, it directs me to a source code page (HTML) in which the scripts should be.

This is the tag:

<script src="/scripts?v=r8NL2JoYrRk4WG4L8aUu1037yymdncGQgFxOAcbEyw41"></script>

And this is the link: script_tag_link

Here is how the page of the link looks: Here should be the compressed scripts

1 Answer 1

1

The ScriptBundle name, in this case "~/scripts", shouldn't match an existing folder in your application. Try changing it to "~/bundles".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.