🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@zbanx/umi-plugin-cookies

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zbanx/umi-plugin-cookies

set default cookie in umi

latest
npmnpm
Version
1.1.1
Version published
Maintainers
4
Created
Source

@zbanx/umi-plugin-cookies

@zbanx/umi-plugin-cookies.

Install

Using npm:

$ npm install --save-dev @zbanx/umi-plugin-cookies

or using yarn:

$ yarn add @zbanx/umi-plugin-cookies --dev

配置

可配置项

export default {
  cookies: {
    // 跳过的域名列表
    skipDomains: ['local.tbanx.cn'],

    // 自动设置 Cookie: testKey=testValue
    testKey: 'testValue',
  },
}

或者在 .umirc.ts 里配置:

export default defineConfig({
  nodeModulesTransform: {
    type: 'none',
  },
  routes: [
    { path: '/', component: '@/pages/index' },
  ],
  fastRefresh: {},
  cookies: {
    skipDomains: ['local.tbanx.cn'],
    testKey: 'testValue',
  },
});

本地调试

npm link

在项目中调试

需要在项目package.json中添加开发依赖

{
  "devDependencies": {
    "@zbanx/umi-plugin-cookies": "latest"
  }
}
npm link @zbanx/umi-plugin-cookies
npm run dev

FAQs

Package last updated on 08 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts