• Stars
    star
    448
  • Rank 93,821 (Top 2 %)
  • Language
    C#
  • License
    Other
  • Created almost 9 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Visual Studio extension for compiling LESS and Sass files

Web Compiler

A Visual Studio extension that compiles LESS, Sass Stylus, JSX, ES6 and CoffeeScript files.

Build status

Download the extension at the VS Gallery or get the nightly build

See the changelog for changes and roadmap.

Features

  • Compilation of LESS, Scss, Stylus, JSX, ES6 and (Iced)CoffeeScript files
  • Saving a source file triggers re-compilation automatically
  • Specify compiler options for each individual file
  • Error List integration
  • MSBuild support for CI scenarios
  • Minify the compiled output
  • Minification options for each language is customizable
  • Shows a watermark when opening a generated file
  • Shortcut to compile all specified files in solution
  • Task Runner Explorer integration
  • Command line interface
  • Integrates with Web Analyzer

Getting started

Right-click any .less, .scss, .styl, .jsx, .es6 or .coffee file in Solution Explorer to setup compilation.

Compile file

A file called compilerconfig.json is created in the root of the project. This file lets you modify the behavior of the compiler.

Right-clicking the compilerconfig.json file lets you easily run all the configured compilers.

Recompile

Compile on save

Any time a .less, .scss, .styl, .jsx, .es6 or .coffee file is modified within Visual Studio, the compiler runs automatically to produce the compiled output file.

The same is true when saving the compilerconfig.json file where all configured files will be compiled.

Compile on build / CI support

In ASP.NET MVC and WebForms projects you can enable compilation as part of the build step. Simply right-click the compilerconfig.json file to enable it.

Compile on build

Clicking the menu item will prompt you with information about what will happen if you click the OK button.

Compile on build prompt

A NuGet package will be installed into the packages folder without adding any files to the project itself. The NuGet package contains an MSBuild task that will run the exact same compilers on the compilerconfig.json file in the root of the project.

Compile all

You can run the compiler on all compilerconfig.json files in the solution by using the keyboard shortcut Shift+Alt+Y or by using the button on the top level Build menu.

Compile all

Task Runner Explorer

Get a quick overview of the files you've specified or execute a compilation directly in Task Runner Explorer.

Task Runner Explorer

You can even set bindings so that compilation happens automatically during certain Visual Studio events, such as BeforeBuild and Project Open.

Task Runner bindings

Error list

When a compiler error occurs, the error list in Visual Studio will show the error and its exact location in the source file.

Error List

Source maps

Source maps are supported for .scss files only for now, but the plan is to have source map support for all languages. Web Compiler differs from it's predecesor, Web Essentials, in that it inlines a base64 encoded version of the map in the generated .css file rather than producing a separate .map file.

compilerconfig.json

The extension adds a compilerconfig.json file at the root of the project which is used to configure all compilation.

Here's an example of what that file looks like:

[
  {
    "outputFile": "output/site.css",
    "inputFile": "input/site.less",
    "minify": {
        "enabled": true
    },
    "includeInProject": true,
    "options":{
        "sourceMap": false
    }
  },
  {
    "outputFile": "output/scss.css",
    "inputFile": "input/scss.scss",
    "minify": {
        "enabled": true
    },
    "includeInProject": true,
    "options":{
        "sourceMap": true
    }
  }
]

Default values for compilerconfig.json can be found in the compilerconfig.json.defaults file in the same location.

More Repositories

1

Miniblog.Core

An ASP.NET Core blogging engine
JavaScript
1,449
star
2

WebEssentials2013

Visual Studio extension
C#
949
star
3

MiniBlog

A minimal blog engine using Razor Web Pages
C#
915
star
4

BundlerMinifier

Visual Studio extension
C#
598
star
5

ShortcutExporter

Visual Studio extension
C#
481
star
6

MarkdownEditor

A Visual Studio extension
C#
397
star
7

WebEssentials.AspNetCore.ServiceWorker

C#
336
star
8

WebEssentials2015

A Visual Studio extension for web developers
C#
302
star
9

AddAnyFile

A Visual Studio extension
C#
256
star
10

Tweakster

A Visual Studio extension
C#
239
star
11

PhotoGallery

ASP.NET Core Photo Gallery
C#
170
star
12

OpenCommandLine

A Visual Studio extension
C#
157
star
13

ExtensibilityTools

Tools for writing Visual Studio extensions
C#
153
star
14

MarkdownEditor2022

A Visual Studio extension
C#
152
star
15

JavaScriptPrettier

A Visual Studio extension
C#
151
star
16

EditorConfigLanguage

A Visual Studio extension
C#
129
star
17

RainbowBraces

A Visual Studio extension
C#
129
star
18

FileDiffer

A Visual Studio extension
C#
128
star
19

TrailingWhitespace

Display trailing whitespace in any VS editor
C#
118
star
20

FileNesting

Nest files in Solution Explorer
C#
117
star
21

FileIcons

A Visual Studio extension
C#
115
star
22

PrivateGalleryCreator

Create private extension galleries for Visual Studio
C#
112
star
23

WebEssentials2012

C#
96
star
24

NpmTaskRunner

Visual Studio extension
C#
87
star
25

TypeScriptDefinitionGenerator

A Visual Studio extension
C#
81
star
26

ZenCodingVS

A Visual Studio extension
C#
70
star
27

SolutionColors

A Visual Studio extension
C#
69
star
28

ExtensionPackTools

A Visual Studio extension
C#
67
star
29

MarkSite

A markdown powered CMS written in ASP.NET
C#
66
star
30

RestClientVS

C#
66
star
31

TextmateBundleInstaller

A Visual Studio extension
C#
65
star
32

ShowTheShortcut

A Visual Studio extension
C#
65
star
33

PackageInstaller

A Visual Studio extension
C#
64
star
34

CodeCleanupOnSave

C#
63
star
35

VuePack

C#
61
star
36

OpenInVsCode

A Visual Studio extension
C#
61
star
37

WebAnalyzer

A Visual Studio extension
C#
55
star
38

WebEssentials.AspNetCore.OutputCaching

C#
52
star
39

CommentRemover

A Visual Studio extension
C#
51
star
40

WebEssentials2019

C#
49
star
41

WebEssentials.AspNetCore.CdnTagHelpers

A CDN helper for ASP.NET Core
C#
47
star
42

ImageOptimizerWebJob

C#
47
star
43

DialToolsForVS

A Visual Studio extension
C#
47
star
44

ReverseProxyCDN

C#
42
star
45

CommandTaskRunner

A Visual Studio extension
C#
42
star
46

JSON-Intellisense

NPM package Intellisense in package.json
C#
40
star
47

WebPackTaskRunner

A Visual Studio extension
C#
40
star
48

VuePack2017

A Visual Studio extension
C#
38
star
49

AspNetCoreTemplatePack

C#
38
star
50

SolutionExtensions

A Visual Studio extension
C#
36
star
51

FeedCollector

A simple website for aggregating RSS/Atom feeds
C#
36
star
52

Surrounder

A Visual Studio extension
C#
34
star
53

WebAccessibilityChecker

A Visual Studio extension
C#
34
star
54

ClearComponentCache

A Visual Studio extension
C#
33
star
55

PrettyPaste

Fixes the added blank lines when copying and pasting from IE
C#
32
star
56

VsixGallery

The Open VSIX Gallery
C#
32
star
57

ImageSprites

A Visual Studio extension
C#
32
star
58

Editorsk

A Visual Studio extension
C#
30
star
59

JavaScriptSnippetPack

A Visual Studio extension
Vim Snippet
30
star
60

CloseAllTabs

A Visual Studio extension
C#
30
star
61

IgnoreFiles

A Visual Studio extension
C#
29
star
62

zencoding

Provides hybrid ZenCoding for Web Essentials
C#
29
star
63

ImagePreview

C#
28
star
64

DarkTheme2019

C#
28
star
65

KnownMonikersExplorer

A Visual Studio extension
C#
28
star
66

CommandTableInfo

A Visual Studio extension
C#
28
star
67

Madskristensen.VisualStudio.SDK

Visual Studio SDK meta packages
28
star
68

ExtensionGallery

A Visual Studio extension gallery
C#
28
star
69

Packman

A client-side package manager
C#
28
star
70

TemplateCreator

A Visual Studio extension
C#
27
star
71

BasicEssentials

26
star
72

DeveloperNews

C#
26
star
73

BrowserReloadOnSave

A Visual Studio extension
C#
26
star
74

SvgViewer

Shows the rendered image of .svg files
C#
25
star
75

StaticWebHelper

Perf optimize static websites hosted on IIS
C#
25
star
76

MIDL

A Visual Studio extension
C#
24
star
77

WorkspaceFiles

C#
24
star
78

vswebessentials.com

The official website of Web Essentials for Visual Studio
C#
23
star
79

ExtensionUpdater

Visual Studio extension for auto updating extensions
C#
23
star
80

Community.VisualStudio.Toolkit

A community toolkit for writing Visual Studio extensions
C#
23
star
81

CssTools

A Visual Studio extension
C#
22
star
82

InsertGuid

A Visual Studio extension
C#
22
star
83

ExtensionScripts

PowerShell
22
star
84

ErrorHighlighter

Visual Studio extension
C#
21
star
85

CopyNice

A Visual Studio extension
C#
21
star
86

SpaTemplatePack

A Visual Studio extension
C#
20
star
87

EditorColorPreview

C#
20
star
88

Madskristensen.VisualStudio.SDK.HelpersOLD

C#
19
star
89

VsctIntellisense

Intellisense for VSCT files
C#
19
star
90

JavaScriptRegions

A Visual Studio extension
C#
19
star
91

OptionsSample

A Visual Studio extension sample
C#
19
star
92

JsonSchemaGenerator

A Visual Studio extension
C#
18
star
93

WebEssentialsChrome

A browser extension
JavaScript
18
star
94

MiniBlogFormatter

C#
17
star
95

PkgdefLanguage

A Visual Studio extension
C#
17
star
96

TomlEditor

C#
16
star
97

HtmlSnippetPack

A Visual Studio extension
Vim Snippet
16
star
98

LessCompiler

A Visual Studio extension
C#
16
star
99

VuePack2019

C#
16
star
100

OutputWindowFilter

C#
15
star