Giter Site home page Giter Site logo

gmh5225 / webcompiler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from madskristensen/webcompiler

0.0 0.0 0.0 12.02 MB

Visual Studio extension for compiling LESS and Sass files

License: Other

JavaScript 0.07% CoffeeScript 0.62% C# 97.42% CSS 0.03% Handlebars 0.09% Batchfile 0.99% Less 0.47% SCSS 0.21% Stylus 0.11%

webcompiler's Introduction

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.

webcompiler's People

Contributors

madskristensen avatar gproulx avatar paulvrugt avatar krusen avatar mlorbetske avatar djanosik avatar jws305 avatar alexjustus avatar samfromlv avatar andrewiggins avatar craigktreasure avatar achbed avatar duncansmart avatar drphrozen avatar iouri-s avatar michalstanko avatar outlivier avatar kiasyn avatar sguryev avatar falahati avatar jkewley avatar markvantilburg avatar winterific avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.