1. webpack-espower-loader
Power Assert module for webpack
webpack-espower-loader
Package: webpack-espower-loader
Created by: power-assert-js
Last modified: Tue, 28 Jun 2022 23:51:34 GMT
Version: 2.0.0
License: MIT
Downloads: 1,115
Repository: https://github.com/power-assert-js/webpack-espower-loader

Install

npm install webpack-espower-loader
yarn add webpack-espower-loader

Build Status
NPM package
Dependency Status
License

webpack-espower-loader

Power Assert instrumentor module for webpack.

Description

webpack-espower-loader is a webpack loader module for power-assert.
webpack-espower-loader applies espower to target sources through webpack loader chain.

Pull-requests, issue reports and patches are always welcomed.

See power-assert project for more documentation.

FAQ

webpack-espower-loader does not work with babel-loader!

webpack-espower-loader does not work with babel-loader due to the change of transpiled code since babel 5.0. Please use babel-plugin-espower with babel-loader.

Installation

Install power-assert and webpack-espower-loader via npm:

 $ npm install --save-dev webpack-espower-loader

Caution

For webpack3 or lower, you need to use the 1.x release of webpack-espower-loader.

$ npm install --save-dev [email protected]

Usage

Configure webpack.config.js to apply webpack-espower-loader through webpack loader transformation chain. Options are passed through to espower.
If not passed, default options (Same as espower.defaultOptions()) will be used.

 {
    module: {
        exprContextCritical: false,
        rules: [{
            test: /_test\.js$/,
            use: [{
                loader: "webpack-espower-loader",
                options: {
                    patterns: [
                        'assert(value, [message])',
                        'assert.ok(value, [message])',
                        'assert.equal(actual, expected, [message])',
                        'assert.notEqual(actual, expected, [message])',
                        'assert.strictEqual(actual, expected, [message])',
                        'assert.notStrictEqual(actual, expected, [message])',
                        'assert.deepEqual(actual, expected, [message])',
                        'assert.notDeepEqual(actual, expected, [message])'
                    ]
                }
            }]
        }]
    }
}

Changelog

See CHANGELOG.md.

Author

Contributors

License

Licensed under the MIT license. See LICENSE.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin