@averjs/typescript
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

@averjs/typescript

Official aver package for typescript support.

Usage

Install the package

$ yarn add --dev @averjs/typescript
#or
$ npm i -D @averjs/typescript

Add the plugin to the buildPlugins array inside your aver-config.ts

export default {
  buildPlugins: [
    '@averjs/typescript'
  ]
}

Options

You can pass either one of the following options to the plugin

export default {
  buildPlugins: [
    [
      '@averjs/typescript',
      {
        tsLoader: {},
        // or
        tsLoader: (default) => ({ ...default, /* add additional config */ }),

        forkTsChecker: {},
        // or
        forkTsChecker: (default) => ({ ...default, /* add additional config */ }),
      }
    ]
  ]
}

tsLoader

  • Type: object | function
  • Default:
    {
      transpileOnly: true,
      happyPackMode: true,
      appendTsSuffixTo: [/\.vue$/]
    }

You can either pass an object with the loader options, which can be found here, or you can also use a function which is getting passed the default config, can be modified and should return a valid config.

forkTsChecker

  • Type: object | function
  • Default:
    {
      typescript: {
        configFile: path.resolve(process.env.PROJECT_PATH, '../tsconfig.json'),
        extensions: {
          vue: true
        }
      },
      formatter: 'codeframe',
      async: false,
      eslint: {
        files: [
          './src/**/*.vue',
          './src/**/*.ts'
        ]
      }
    }

You can either pass an object with the plugin options, which can be found here, or you can also use a function which is getting passed the default config, can be modified and should return a valid config.

Readme

Keywords

none

Package Sidebar

Install

npm i @averjs/typescript

Weekly Downloads

2

Version

3.1.0

License

MIT

Unpacked Size

10.6 kB

Total Files

5

Last publish

Collaborators

  • fweber
  • thegorilla