0.1.5 • Published 4 years ago

@andyyou/log-loader v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

log-loader

Loader for webpack to dev and console.log compile result during development.

Usage

Add loader to module.rules

const path = require('path');

module.exports = {
  // ...
  module: {
    rules: [
      {
        test: /\.scss$/,
        use: [
          {
            loader: 'style-loader',
          },
          {
            loader: 'css-loader',
          },
          {
            loader: 'log-loader',
            options: {
              beforeMessage: 'After resolve-url-loader',
            }
          },
          {
            loader: 'resolve-url-loader',
          },
          {
            loader: 'sass-loader',
            options: {
              sourceMap: true,
            }
          }
        ],
      },
    ]
  }
}

Options

optiondescriptiontypedefault
beforeMessageshow message before console resultstring''
afterMessageshow message after console resultstring''

Testing script

// test.js
const webpack = require('webpack');
const config = require('./webpack.config');

const compiler = webpack(config);
compiler.run((err, stats) => {
  console.log('Compiled');
});
$ node test.js
0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago