Visual Studio 2013 removing a part of html document when publishing? - visual-studio-2013

Is it possible to automatically remove a part of an html document when publishing?
For example removing all development script files references and include compiled css or js files instead?
For example:
<!-- remove these-->
<link href="/app/css/animation.css" rel="stylesheet" />
<link href="/app/css/common.loaders.css" rel="stylesheet" />
<link href="/app/css/common.css" rel="stylesheet" />
<!-- include these instead -->
<link href="/app/css/all-files.min.css" rel="stylesheet" />
Thanks

You can use compiler preprocessors like
#{
#if DEBUG
...
#endif
}
or you could use bundles to help you with compression of js files

Related

Is there an advantage of using assets vs not using?

Is there a difference between the two codes below? The reason I'm asking is because when I use the first one the code work as expected but I get a file reference warning at the at the icon in the top-right corner of the PHPStorm in my .blade.php file!
The error is:
File reference problem
Cannot resolve directory plugins
Cannot resolve directory datatables-bs4
Cannot resolve directory css
Cannot resolve directory dataTables.bootstrap4.min.css
"
<link rel="stylesheet" href="/admin/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="{{ asset('admin/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css') }}">

unable to link css file in denjucks template file

I am using deno and denjucks as templating engine. in template .html file header section, I am linking my external css file but failed. the code-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- custom css -->
<link rel="stylesheet" href='../static/style.css'>
the file format is -
main
static
style.css
templates
index.html
Bootstrap link is working but custom css link is not working. Please suggest what is wrong.

Environment tag dosent work?

What is required to get the environment tag to work?
<environment names="Staging,Production">
<link type="text/css" rel="stylesheet" href="~/lib/materialize/dist/css/materialize.min.css" media="screen,projection" />
<link type="text/css" rel="stylesheet" href="~/css/Style.css" media="screen,projection" />
</environment>
Its just rendered just as i wrote it in a .cshtml and not filtered based on the Environment i specified.
It seems you need to add #addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" to the file containing the html, or if you follow the setup of a default project add it to _ViewImports.cshtml.
Also make sure you have added Microsoft.AspNetCore.Mvc.TagHelpers to your project.json.
If you use .NET CORE 1.0, namespace changes to "Microsoft.AspNetCore.Mvc.TagHelpers"
I had this issue because I wasn't using app.UseStaticFiles(); in my startup

how to link bootstrap with codeigniter

I need to connect css styles to codegniter using bootstrap
<link rel="stylesheet" type="text/css" href="<?php echo site_url('css/bootstrap.css'); ?>">
Create one Assets folder in root and add JS CSS and images In that folder and add assets files in your page.
<link rel="stylesheet" type="text/css" href="<?php echo base_url("assets/css/bootstrap.css"); ?>">
You should keep all the static files outside application folder.
Suppose you have a folder named static along with application and system folder. So you can keep all your static files in that folder and then link the files as 'static/css/style.css'
create assest folder in root and add assest/css/bootstrap.min.css then add style
<link rel="stylesheet" type="text/css" href="<?php echo site_url('assest/css/bootstrap.css'); ?>">
first of all you create Assets folder and inside create css folder then include the file bootstrap.min.css . below the code include your view and download the bootstrap css.
<link href="<?= base_url("Assets/css/bootstrap.min.css")?>" rel="stylesheet">

How i can use yeoman to work with Sass files?

I try to use yeoman to compile a styles.sass file founded in app/styles directory.
In my index.html i write :
<!-- build:css(.tmp/styles) styles/styles.css -->
<link rel="stylesheet" href="styles/style.sass" />
<!-- endbuild -->
When i launch grunt server
Sass file is watched and compiled into
.tmp/styles/
But in my dist/styles directory, nothing is written in my xxxxxxx.styles.css
may i miss something?
Your Sass is compiled into .tmp/styles when running grunt server, since it's only temporary. This is done so not to create a mess of compiled CSS files in your app directory. When you run grunt it will compile it to the dist/styles folder.

Resources