From 62002b7c890a6ee97e0ff284efbd797943f5d342 Mon Sep 17 00:00:00 2001 From: zealotchen Date: Wed, 23 Oct 2024 11:28:49 +0800 Subject: [PATCH] feat(web): add web render demo build script --- .../scripts/hippy-webpack.web-renderer.dev.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/hippy-react-demo/scripts/hippy-webpack.web-renderer.dev.js b/examples/hippy-react-demo/scripts/hippy-webpack.web-renderer.dev.js index 90a38933fb0..1855f0483a0 100644 --- a/examples/hippy-react-demo/scripts/hippy-webpack.web-renderer.dev.js +++ b/examples/hippy-react-demo/scripts/hippy-webpack.web-renderer.dev.js @@ -111,6 +111,17 @@ module.exports = { console.warn('* Using the @hippy/react defined in package.json'); } + // If @hippy/web-renderer was built exist in packages directory then make an alias + // Remove the section if you don't use it + const webRendererPath = path.resolve(__dirname, '../../../packages/hippy-web-renderer/dist'); + if (fs.existsSync(path.resolve(webRendererPath, 'index.js'))) { + console.warn(`* Using the @hippy/web-renderer in ${webRendererPath} as @hippy/web-renderer alias`); + aliases['@hippy/web-renderer'] = webRendererPath; + } else { + console.warn('* Using the @hippy/web-renderer defined in package.json'); + } + + return aliases; })(), },