0.5.3 • Published 22 days ago

@quatico/websmith-webpack v0.5.3

Weekly downloads
-
License
MIT
Repository
github
Last release
22 days ago

websmith-webpack

A custom webpack loader to add the websmith compiler to your build and bundling process.

Visit the websmith github repository for more information and examples.

Getting started

Installation

Install the websmith webpack loader using npm:

npm i -D @quatico/websmith-webpack

Add websmith configuration

A websmith.config.json file is needed to configure which addons should be used by websmith during the webpack compilation process:

// websmith.config.json
{
    "targets": {
        "executeAddons": {
            "addons": ["my-addon"],
            "writeFile": false,
        },
    }
}

Note: The webpack loader will expect a target called executeAddons which we need to configure in the webpack configuration.

Add webpack configuration

Now we can use the @quatico/websmith-webpack loader and the websmith configuration to configure webpack.

// webpack.config.js
const { join } = require("path");

module.exports = {
    ...
    module: {
        rules: [
            ...,
            {
                test: /\.(?:[j|t]sx?)$/,
                include: [sourceDir],
                exclude: [/node_modules/],
                use: [
                    {
                        loader: "@quatico/websmith-webpack",
                        options: {
                            project: join(__dirname, "tsconfig.json"),
                            config,
                            targets: "executeAddons",
                            webpackTarget: "executeAddons",
                        },
                    },
                ],
            },
            ...
        ],
    },
};

Bundle your project

You can run webpack in one of your build targets with:

webpack
0.5.3

22 days ago

0.5.2

22 days ago

0.5.1

23 days ago

0.4.1

9 months ago

0.4.2

9 months ago

0.4.0

1 year ago

0.3.5

1 year ago

0.3.0

1 year ago

0.3.2

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.2.1

2 years ago

0.2.2

2 years ago

0.1.0

2 years ago