@funexp/webpack-loader

1.0.0 • Public • Published

@funexp/webpack-loader

The Webpack loader used to integrate funexp with your projects.

Usage

You can use it to load .fun files that contains all the instructions to be compiled:

webpack.config.js

module.exports = {
    entry: "./index.js",
    module: {
        rules: [
            {
                test: /\.fun$/,
                use: "@funexp/webpack-loader"
            }
        ]
    }
};

regex.fun

group(name="letter")
    any
space
literal|is for fun!

index.js

const regex = require("./regex.fun");
console.log("F is for fun!".match(regex));

You can also use it to load files that contains Javascript template literals having the tag fun, that will be compiled into RegExp:

webpack.config.js

module.exports = {
    entry: "./index.js",
    module: {
        rules: [
            {
                test: /\.js$/,
                use: "@funexp/webpack-loader"
            }
        ]
    }
};

index.js

const regex = fun`
group(name="letter")
    any
space
literal|is for fun!
`;

console.log("F is for fun!".match(regex));

Readme

Keywords

none

Package Sidebar

Install

npm i @funexp/webpack-loader

Weekly Downloads

4

Version

1.0.0

License

AGPL-3.0

Unpacked Size

2.6 kB

Total Files

3

Last publish

Collaborators

  • prometeus