How to use ts-import-plugin - 3 common examples

To help you get started, we’ve selected a few ts-import-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alibaba / uform / packages / antd / build.ts View on Github external
import { compile, getCompileConfig } from '../../scripts/build'
import ts from 'typescript'
import tsImportPluginFactory from 'ts-import-plugin'
import glob from 'glob'
import * as fs from 'fs-extra'

const transformer = tsImportPluginFactory({
  libraryName: 'antd',
  // style: 'css',
})

function buildESM() {
  const { fileNames, options } = getCompileConfig(require.resolve('./tsconfig.json'), {
    outDir: './esm',
    module: ts.ModuleKind.ESNext
  })
  compile(fileNames, options)
  console.log('esm build successfully')
}

const TEMP_OUT_DIR = './temp_esm'

function buildTempESM() {
github pingcap / tidb-dashboard / ui / packages / rollup.config.base.js View on Github external
import typescript from 'rollup-plugin-typescript2'
import createTransformer from 'ts-import-plugin'
import commonjs from 'rollup-plugin-commonjs'
import external from 'rollup-plugin-peer-deps-external'
import postcss from 'rollup-plugin-postcss'
import resolve from 'rollup-plugin-node-resolve'
import url from 'rollup-plugin-url'
import svgr from '@svgr/rollup'
import yaml from '@rollup/plugin-yaml'
import lessLoaderConfig from '../less-loader-config.json'

// https://github.com/Brooooooklyn/ts-import-plugin
const transformer = createTransformer({
  libraryDirectory: 'es',
  libraryName: 'antd',
  style: true,
})

export default function baseConfig(pkg) {
  return {
    input: 'src/index.ts',
    output: [
      {
        file: pkg.main,
        format: 'cjs',
        exports: 'named',
        sourcemap: true,
      },
      {
github alibaba / uform / packages / next / build.ts View on Github external
import { compile, getCompileConfig } from '../../scripts/build'
import ts from 'typescript'
import tsImportPluginFactory from 'ts-import-plugin'
import glob from 'glob'
import * as fs from 'fs-extra'

const transformer = tsImportPluginFactory({
  libraryName: '@alifd/next',
  //style: importPath => `${importPath}/style`,
})

function buildESM() {
  const { fileNames, options } = getCompileConfig(require.resolve('./tsconfig.json'), {
    outDir: './esm',
    module: ts.ModuleKind.ESNext
  })
  compile(fileNames, options)
  console.log('esm build successfully')
}

const TEMP_OUT_DIR = './temp_esm'

function buildTempESM() {

ts-import-plugin

babel-plugin-import TypeScript version

MIT
Latest version published 1 year ago

Package Health Score

57 / 100
Full package analysis

Popular ts-import-plugin functions