This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@anolilab/blitz-webpack-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Webpack utils for Blitz.js


Daniel Bannert's open source work is supported by the community on GitHub Sponsors


Install

npm install --dev-save @anolilab/blitz-webpack-utils

or

yarn add --dev @anolilab/blitz-webpack-utils

Usage

These helpers can be used to find specific files in all blitz ['src', 'app', 'integrations'] folders.

This example will find all files in the sub-folder commands and add it to the build process.

import { BlitzConfig, sessionMiddleware, simpleRolesIsAuthorized } from "blitz";
import { collect } from "@anolilab/blitz-webpack-utils";

const config: BlitzConfig = {
    middleware: [
        sessionMiddleware({
            cookiePrefix: "blitz",
            isAuthorized: simpleRolesIsAuthorized,
        }),
    ],
    webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
        if (isServer) {
            return {
                ...config,
                entry() {
                    return config.entry().then(async (entry) => {
                        const allCommands = await collect("commands", __dirname);
                        const commands: { [key: string]: string } = {};

                        allCommands.forEach((commandPath) => {
                            commands[commandPath.replace(/\.[^./]+$/, "").slice(1)] = `.${commandPath}`;
                        });

                        return {
                            ...entry,
                            ...commands,
                        };
                    });
                },
            };
        }

        return config;
    },
};
module.exports = config;

Supported Node.js Versions

Libraries in this ecosystem make the best effort to track Node.js' release schedule. Here's a post on why we think this is important.

Contributing

If you would like to help take a look at the list of issues and check our Contributing guild.

Note: please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Credits

License

The anolilab blitz-webpack-utils is open-sourced software licensed under the MIT license

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i @anolilab/blitz-webpack-utils

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

38.4 kB

Total Files

20

Last publish

Collaborators

  • prisis