taro-define-config
TypeScript icon, indicating that this package has built-in type declarations

0.6.0 • Public • Published

taro-define-config

Provide a defineConfig function for tarojs config

CI NPM VERSION NPM DOWNLOADS LICENSE

[!NOTE]
Taro introduced a builtin defineConfig function since v3.6.9. Maybe you don't need this package.

Usage

// config/index.js

// @ts-check
const { defineConfig } = require('taro-define-config')

module.exports = defineConfig({
  projectName: 'hello-world',
  designWidth: 750,
})
// config/index.ts

import { defineConfig } from 'taro-define-config'

export default defineConfig({
  projectName: 'hello-world',
  designWidth: 750,
})

Why this package

Improve your TaroJS project configuration experience with:

  • 🤖 auto-suggestions
  • ✅ type checking (Use // @ts-check at the first line in your config file)
  • 📖 documentation
  • ⚠️ deprecation warnings

Extend plugin types

declare module 'taro-define-config' {
  export interface CustomPluginOptionsMap {
    'taro-plugin-custom': {
      enable?: boolean
    }
  }
}

Prior Art

Related link

License

MIT License © 2022 to PRESENT ntnyq

Package Sidebar

Install

npm i taro-define-config

Weekly Downloads

14

Version

0.6.0

License

MIT

Unpacked Size

317 kB

Total Files

7

Last publish

Collaborators

  • ntnyq