Skip to content

Commit

Permalink
fix: 导出createXusConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
xuasir committed Feb 5, 2021
1 parent 2618d8f commit fa2aa7b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/cli-plugin-bundler-rollup/src/rollupChian/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ import Plugin, { IPlugin } from './plugin'
import Treeshake from './treeshake'
import Watch from './watch'

type BuiltInlPlugins =
| 'nodeResolve'
| 'commonjs'
| 'babel'
| 'alias'
| 'replace'
| 'vue'
| 'ts'
| string

class Config<T = any> extends ChainedMap<T> {
input!: ChainedMapSet<RollupOptions['input'], this>
cache!: ChainedMapSet<RollupOptions['cache'], this>
Expand All @@ -28,7 +38,7 @@ class Config<T = any> extends ChainedMap<T> {
this.extend(['input', 'cache', 'onwarn', 'context'])
}

plugin(name: string) {
plugin(name: BuiltInlPlugins) {
return this.plugins.getOrCompute(name, () => new Plugin(this, name))
}

Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './types'
export type { IPluginAPI } from './PluginAPI'
export * from './utils'
export { createXusConfig } from './options'
2 changes: 2 additions & 0 deletions packages/cli/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ export function defaultProjectConfig(contextPath: string): ProjectConfig {
contextPath
}
}

export const createXusConfig = (config: ProjectConfig) => config

0 comments on commit fa2aa7b

Please sign in to comment.