Skip to content

shifteee/webpack-loader-api-exec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webpack-loader-api-exec

Since webpack team deprecate usage this.exec inside Loader Api we need in something that could execute code string as normal javascript. This module provide similar functionality

Usage

const exec = require('webpack-loader-api-exec');

module.exports = function(code) {
    const ctx = {}
    const opts = {}
    const content = (typeof code === 'string')
        ? exec(code, opts, ctx)
        : code;

    // process content
    // ...

    return result;
}

About

Replace this.exec inside webpack loader

Resources

License

Stars

Watchers

Forks

Packages

No packages published