# Introduction

VERSION NOTE

This is the documentation for Kdu Loader v15 and above.

# What is Kdu Loader?

kdu-loader is a loader for webpack (opens new window) that allows you to author Kdu components in a format called Single-File Components (SFCs):

<template>
  <div class="example">{{ msg }}</div>
</template>

<script>
export default {
  data () {
    return {
      msg: 'Hello world!'
    }
  }
}
</script>

<style>
.example {
  color: red;
}
</style>

There are many cool features provided by kdu-loader:

  • Allows using other webpack loaders for each part of a Kdu component, for example Sass for <style> and Pug for <template>;
  • Allows custom blocks in a .kdu file that can have custom loader chains applied to them;
  • Treat static assets referenced in <style> and <template> as module dependencies and handle them with webpack loaders;
  • Simulate scoped CSS for each component;
  • State-preserving hot-reloading during development.

In a nutshell, the combination of webpack and kdu-loader gives you a modern, flexible and extremely powerful front-end workflow for authoring Kdu.js applications.