Skip to content

Commit

Permalink
refactor(build): add build docs flow in CI and remove dynamic style i…
Browse files Browse the repository at this point in the history
…nject
  • Loading branch information
janryWang committed Aug 26, 2019
1 parent 045f6fe commit 1fb5cc0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ before_script:
script:
- npm run lint
- npm run build
- npm run build:docs
- npm run test:prod
12 changes: 6 additions & 6 deletions packages/antd/build.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { compile, getCompileConfig } from '../../scripts/build'
import ts from 'typescript'
import tsImportPluginFactory from 'ts-import-plugin'
//import tsImportPluginFactory from 'ts-import-plugin'
import glob from 'glob'

const transformer = tsImportPluginFactory({
libraryName: 'antd',
style: 'css',
})
// 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, { before: [transformer] })
compile(fileNames, options)
console.log('esm build successfully')
}

Expand Down
12 changes: 6 additions & 6 deletions packages/next/build.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { compile, getCompileConfig } from '../../scripts/build'
import ts from 'typescript'
import tsImportPluginFactory from 'ts-import-plugin'
//import tsImportPluginFactory from 'ts-import-plugin'
import glob from 'glob'

const transformer = tsImportPluginFactory({
libraryName: '@alifd/next',
style: importPath => `${importPath}/style`,
})
// 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, { before: [transformer] })
compile(fileNames, options)
console.log('esm build successfully')
}

Expand Down

0 comments on commit 1fb5cc0

Please sign in to comment.