1. @poi/plugin-typescript
Official TypeScript plugin for Poi.
@poi/plugin-typescript
Package: @poi/plugin-typescript
Last modified: Sun, 12 Jun 2022 22:43:09 GMT
Version: 12.3.1
Downloads: 3,251

Install

npm install @poi/plugin-typescript
yarn add @poi/plugin-typescript

@poi/plugin-typescript

Official TypeScript plugin for Poi.

Introduction

This plugin use ts-loader to transpile TypeScript files, it also uses fork-ts-checker-webpack-plugin to perform type-checking. .ts .tsx and .vue files are supported.

It's possible to run Babel alongside TypeScript using the babel option. When used with Babel, it's recommended to set compilerOptions.target to es2015 or later in tsconfig.json to delegate the rest to Babel for auto polyfill based on browser targets.

Install

 yarn add @poi/plugin-typescript typescript --dev

How to use

 module.exports = {
  plugins: [
    {
      resolve: '@poi/plugin-typescript',
      options: {}
    }
  ]
}

Then add a tsconfig.json in your project:

 {
  "compilerOptions": {
    "target": "es5",
    "strict": true,
    "module": "es2015",
    "moduleResolution": "node"
  }
}

Options

babel

  • Type: boolean
  • Default: false

Use Babel after the TypeScript compiler.

lintOnSave

  • Type: boolean
  • Default: true

Lint TS files with ts-lint at compile time, note that it will only work when you have a tslint.json in your project root.

configFile

  • Type: string
  • Default: tsconfig.json

The path to the TypeScript config file.

loaderOptions

  • Type: any

Addtional options for ts-loader.

tscheckerOptions

  • Type: any

Additional options for fork-ts-checker-webpack-plugin.

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin