Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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() {
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,
},
{
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() {