@@ -4,16 +4,13 @@ import HtmlWebpackPlugin from 'html-webpack-plugin'
44import webpack from 'webpack'
55import cors from 'cors'
66import webpackBase from '../webpack.base.ts'
7- import logsConfig from '../packages/logs/webpack.config.ts'
8- import rumSlimConfig from '../packages/rum-slim/webpack.config.ts'
9- import rumConfig from '../packages/rum/webpack.config.ts'
10- import flaggingConfig from '../packages/flagging/webpack.config.ts'
11- import workerConfig from '../packages/worker/webpack.config.ts'
127import { printLog , runMain } from './lib/executionUtils.ts'
138
149const sandboxPath = './sandbox'
1510const port = 8080
1611
12+ const PACKAGES_WITH_BUNDLE = [ 'rum' , 'rum-slim' , 'logs' , 'flagging' , 'worker' ]
13+
1714runMain ( ( ) => {
1815 const app = express ( )
1916 app . use ( createStaticSandboxApp ( ) )
@@ -25,8 +22,19 @@ function createStaticSandboxApp(): express.Application {
2522 const app = express ( )
2623 app . use ( cors ( ) )
2724 app . use ( express . static ( sandboxPath ) )
28- for ( const config of [ rumConfig , rumSlimConfig , logsConfig , flaggingConfig , workerConfig ] ) {
29- app . use ( middleware ( webpack ( config ( null , { mode : 'development' } ) ) ! ) )
25+ for ( const packageName of PACKAGES_WITH_BUNDLE ) {
26+ const packagePath = `./packages/${ packageName } `
27+ app . use (
28+ middleware (
29+ webpack (
30+ webpackBase ( {
31+ mode : 'development' ,
32+ entry : `${ packagePath } /src/entries/main.ts` ,
33+ filename : packageName === 'worker' ? 'worker.js' : `datadog-${ packageName } .js` ,
34+ } )
35+ ) !
36+ )
37+ )
3038 }
3139
3240 // Redirect suffixed files
0 commit comments