From 49b2ada863d42aa90c739ff0519796b92686e08e Mon Sep 17 00:00:00 2001 From: Wei Wu Date: Wed, 30 Aug 2023 15:32:27 +0800 Subject: [PATCH] build: move notebook renderer build to esbuild --- tools/build.mjs | 5 +++++ webpack.config.js | 41 +---------------------------------------- 2 files changed, 6 insertions(+), 40 deletions(-) diff --git a/tools/build.mjs b/tools/build.mjs index 4863d25a1..ae9b34f0b 100644 --- a/tools/build.mjs +++ b/tools/build.mjs @@ -45,8 +45,13 @@ const nodeBuildOptions = { const browserBuildOptions = { ...commonBuildOptions, + format: "esm", entryPoints: { "./client/dist/webview/DataViewer": "./client/src/webview/DataViewer.tsx", + "./client/dist/notebook/LogRenderer": + "./client/src/components/notebook/renderers/LogRenderer.ts", + "./client/dist/notebook/HTMLRenderer": + "./client/src/components/notebook/renderers/HTMLRenderer.ts", }, }; diff --git a/webpack.config.js b/webpack.config.js index 5c1153916..c5a5f505e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -101,43 +101,4 @@ const browserServerConfig = { devtool: "source-map", }; -/** @type WebpackConfig */ -const notebookRendererConfig = { - context: path.join(__dirname, "client"), - mode: "none", - entry: { - LogRenderer: "./src/components/notebook/renderers/LogRenderer.ts", - HTMLRenderer: "./src/components/notebook/renderers/HTMLRenderer.ts", - }, - output: { - filename: "[name].js", - path: path.join(__dirname, "client", "dist", "notebook"), - libraryTarget: "module", - }, - module: { - rules: [ - { - test: /\.ts$/, - exclude: /node_modules/, - use: [ - { - loader: "ts-loader", - }, - ], - }, - ], - }, - experiments: { - outputModule: true, - }, - performance: { - hints: false, - }, - devtool: "source-map", -}; - -module.exports = [ - browserClientConfig, - browserServerConfig, - notebookRendererConfig, -]; +module.exports = [browserClientConfig, browserServerConfig];