Replies: 11 comments 9 replies
-
webpack => configureWebpack 内部使用webpack merge, 这是vue-cli使用的key,目的应该也是一大块的自定义方便写入。 |
Beta Was this translation helpful? Give feedback.
-
我准备尝试实现: |
Beta Was this translation helpful? Give feedback.
-
暂时定义import {Configuration, container} from 'webpack/types'
import Config from 'webpack-chain/types'
type MFOptions = ConstructorParameters<typeof container.ModuleFederationPlugin>[0]
declare interface EMPConfig {
/** webpack config */
webpack?: (wp: Configuration, empEnv: string, webpackEnv: 'development' | 'production') => Configuration
/** webpack chain config */
webpackChain?: (wpc: Config, empEnv: string, webpackEnv: 'development' | 'production') => void
/** compile replace babel use swc or esbuild */
compile?: Array<any>
/** react vue svetle and more */
framework?: Array<any>
/** module federation config */
moduleFederation?: MFOptions
} |
Beta Was this translation helpful? Give feedback.
-
优化内容:TODO
|
Beta Was this translation helpful? Give feedback.
-
ts 配置 emp |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
emp 插件 from branch v1.8.0-register-pluginTODO:
1. 局部插件,仅用于当前项目:例如:
register({
name: 'hello',
options: [{name: '-i, --item <item>', description: 'flavour of pizza'}],
exec: ({item}) => {
console.log(`hell ${item}`)
},
}) 2. 全局插件,包名前缀需要为
|
Beta Was this translation helpful? Give feedback.
-
避免非ts 项目需要用 类型提示 考虑增加 js 的类型提示函数引入 |
Beta Was this translation helpful? Give feedback.
-
emp-config.js 增加类型提示的方法/**
* @type {import('@efox/emp-cli').EMPConfig}
*/
module.exports = {
webpack({webpackEnv}) {
console.log('webpack', webpackEnv)
return {
devServer: {
port: 8001,
},
}
},
moduleGenerator({webpackEnv}) {
console.log('moduleGenerator', webpackEnv)
return webpackEnv === 'development' ? '/' : `http://localhost:8001/`
},
async moduleFederation({webpackEnv}) {
return mf(webpackEnv)
},
} |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
esbuild 全局安装收到影响 导致 cli有问题 需要 |
Beta Was this translation helpful? Give feedback.
-
1 emp-config 优化 [已完成]
2 插件化接入EMP [已完成]
3 引用外部基站可视化 [重新评估]
Beta Was this translation helpful? Give feedback.
All reactions