GithubHelp home page GithubHelp logo

anolilab / blitz-webpack-utils Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 1.15 MB

Webpack utils for Blitz.js

License: MIT License

JavaScript 16.54% Shell 7.77% TypeScript 75.69%
anolilab typescript blitz blitzjs webpack

blitz-webpack-utils's Introduction

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

blitz-webpack-utils's People

Contributors

github-actions[bot] avatar prisis avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar

blitz-webpack-utils's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update actions/stale action to v6
  • chore(deps): update dependency @types/node to v18
  • chore(deps): update dependency eslint-plugin-jest to v27
  • chore(deps): update dependency sort-package-json to v2
  • chore(deps): update devdependencies (major) to v29 (major) (@types/jest, jest, jest-mock, ts-jest)
  • chore(deps): update node.js to v18
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/greetings.yml
  • actions/first-interaction v1
.github/workflows/markdown-lint.yml
  • actions/checkout v2
  • actions/setup-node v2
  • actions/cache v2
.github/workflows/semantic-release.yml
  • actions/checkout v2
  • actions/setup-node v2
  • actions/cache v2
.github/workflows/stale-issues.yml
  • actions/stale v3
  • actions/stale v3
  • actions/stale v3
  • actions/stale v3
.github/workflows/yaml-lint.yml
  • actions/checkout v2
  • ibiqlik/action-yamllint v3
npm
package.json
  • @anolilab/babel-preset ^5.0.0
  • @anolilab/eslint-config ^4.0.0
  • @anolilab/prettier-config ^3.0.0
  • @anolilab/semantic-release-preset ^2.0.0
  • @anolilab/textlint-config ^4.0.0
  • @babel/core ^7.15.0
  • @babel/eslint-parser ^7.15.0
  • @babel/plugin-syntax-jsx ^7.14.5
  • @babel/preset-typescript ^7.15.0
  • @babel/runtime ^7.15.3
  • @types/jest ^28.0.0
  • @types/node 16.11.42
  • @typescript-eslint/eslint-plugin ^5.0.0
  • @typescript-eslint/parser ^5.0.0
  • cross-env ^7.0.3
  • eslint ^8.0.0
  • eslint-plugin-jest ^26.0.0
  • eslint-plugin-node ^11.1.0
  • husky ^8.0.0
  • jest ^28.0.0
  • jest-mock ^28.0.0
  • lint-staged ^13.0.0
  • microbundle ^0.15.0
  • prettier ^2.3.2
  • semantic-release ^19.0.0
  • sort-package-json ^1.50.0
  • ts-jest ^28.0.0
  • ts-node ^10.2.1
  • typescript ^4.4.2
  • node >=12
  • yarn 3.2.1
nvm
.nvmrc
  • node 12.22.8

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.