Skip to content

Commit 1e14aab

Browse files
authored
feat: 支持webpack 自定义build (#276)
build时支持 `customBuildPath`参数,自定义构建入口文件
1 parent 6dce108 commit 1e14aab

File tree

1 file changed

+4
-0
lines changed
  • packages/beidou-cli/lib/commands

1 file changed

+4
-0
lines changed

packages/beidou-cli/lib/commands/build.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ module.exports = class BuildCMD extends Command {
3535
path.join(__dirname, '../../../beidou-webpack/bin/build.js'),
3636
() => require.resolve('beidou-webpack/bin/build'),
3737
];
38+
const customBuildPath = context.argv.customBuildPath || '';
39+
if(customBuildPath) {
40+
buildPaths.unshift(path.join(context.cwd, customBuildPath));
41+
}
3842
const buildBin = buildPaths.find(p =>
3943
fs.existsSync(typeof p === 'function' ? p() : p)
4044
);

0 commit comments

Comments
 (0)