0.1.2-beta • Published 8 years ago

@domjtalbot/sassdoc-loader v0.1.2-beta

Weekly downloads
97
License
MIT
Repository
github
Last release
8 years ago

sassdoc-loader

Build Status npm version

Webpack loader for sassdoc

Install

$ npm install @domjtalbot/sassdoc-loader

Usage

Documentation: using loaders

Within your webpack configuration, you'll need to add the sassdoc-loader to the list of modules. As the current version of webpack doesn't look for scoped packages, sassdoc-loader needs to be referenced with its full name.

module.exports = {
  // ...
  module: {
    postLoaders: [
      {
          test: /\.scss$/,
          loader: "@domjtalbot/sassdoc-loader",
          exclude: /node_modules/
      }
    ]
  }
  // ...
}

Configuration

module.exports = {
  // ...
  sassdoc: {
      // Output location
      // Default: Sassdoc default
      dest: String,

      // Configuration file
      // Default: null
      config: String,

      // Specify a theme
      // Default: null
      theme: String,

      // File/files to parse
      // Default: Webpack input
      entry: String,
  },
  // ...
}

Example webpack.config

module.exports = {
    entry: {
        app: './app.js'
    },
    output: {
        path: './public',
    },
    module: {
        preLoaders: [
            {
                test: [/\.scss$/],
                exclude: /(node_modules|bower_components)/,
                loader: 'scsslint'
            }
        ],
        loaders: [
            {
                test: [/\.scss$/],
                exclude: /(node_modules|bower_components)/,
                loader: 'sass'
            }
        ],
        postLoaders: [
            {
                test: [/\.scss$/],
                exclude: /(node_modules|bower_components)/,
                loader: '@domjtalbot/sassdoc-loader'
            }
        ]
    }
    sassdoc: {
        entry: './assets/scss/*.scss .assets/scss/**/*.scss',
        config: '.sassdoc.yml'
    },
};