From 53f458a6533973ca6be3435880aadecaf6c74363 Mon Sep 17 00:00:00 2001 From: CloudXR CI Date: Thu, 21 May 2026 21:38:17 +0000 Subject: [PATCH] Update samples (34c78d3d) --- react/package.json | 2 +- react/webpack.common.js | 19 ++++++------------- react/webpack.dev.js | 2 +- simple/webpack.common.js | 14 ++++++-------- simple/webpack.dev.js | 2 +- 5 files changed, 15 insertions(+), 24 deletions(-) diff --git a/react/package.json b/react/package.json index 3e42265..5a9b792 100644 --- a/react/package.json +++ b/react/package.json @@ -17,7 +17,7 @@ "dev": "webpack --config ./webpack.dev.js", "dev-server": "webpack serve --config ./webpack.dev.js --no-open", "dev-server:https": "cross-env HTTPS=true webpack serve --config ./webpack.dev.js --no-open", - "clean": "rimraf dist" + "clean": "rimraf build dist" }, "dependencies": { "@nvidia/cloudxr": "dev", diff --git a/react/webpack.common.js b/react/webpack.common.js index e41ec66..5d0af12 100644 --- a/react/webpack.common.js +++ b/react/webpack.common.js @@ -19,9 +19,8 @@ const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const webpack = require('webpack'); +const { nvidiaCloudxrWebpackAlias } = require('../webpack-nvidia-cloudxr-alias.cjs'); -// WebXR input profile assets are used by default when @webxr-input-profiles/assets is installed. -// Set USE_LOCAL_WEBXR_ASSETS=0 to skip bundling local assets (build needs internet at runtime to load assets). const useLocalWebxrAssets = process.env.USE_LOCAL_WEBXR_ASSETS !== '0'; let webxrAssetsPackagePath = null; let WEBXR_ASSETS_VERSION = ''; @@ -40,15 +39,14 @@ if (useLocalWebxrAssets) { module.exports = { entry: './src/index.tsx', - // Enable webpack 5 persistent filesystem caching for faster incremental builds cache: { type: 'filesystem', + name: 'react', buildDependencies: { config: [__filename], }, }, - // Module rules define how different file types are processed module: { rules: [ { @@ -56,7 +54,6 @@ module.exports = { use: { loader: 'ts-loader', options: { - // Only transpile, don't type-check (faster builds) transpileOnly: true, }, }, @@ -69,35 +66,31 @@ module.exports = { ], }, - // Resolve configuration for module resolution resolve: { extensions: ['.tsx', '.ts', '.js'], alias: { - // @helpers can be used instead of relative paths to the helpers directory '@helpers': path.resolve(__dirname, './helpers'), + // If OVERRIDE_CLOUDXR_FILENAME is set (testing only), @nvidia/cloudxr resolves to that bundle + // basename next to package main—not for production. See ../webpack-nvidia-cloudxr-alias.cjs. + ...nvidiaCloudxrWebpackAlias(__dirname), }, }, - // Output configuration for bundled files output: { filename: 'bundle.js', - path: path.resolve(__dirname, './build'), + path: path.resolve(__dirname, 'build'), }, - // Webpack plugins that extend webpack's functionality plugins: [ - // Generates HTML file and automatically injects bundled JavaScript new HtmlWebpackPlugin({ template: './src/index.html', favicon: './favicon.ico', }), - // Inject environment variables new webpack.DefinePlugin({ 'process.env.WEBXR_ASSETS_VERSION': JSON.stringify(WEBXR_ASSETS_VERSION), }), - // Copies WebXR input profile assets when available; always copies public and favicon new CopyWebpackPlugin({ patterns: [ ...(webxrAssetsPackagePath diff --git a/react/webpack.dev.js b/react/webpack.dev.js index 7618cdc..2df72b9 100644 --- a/react/webpack.dev.js +++ b/react/webpack.dev.js @@ -38,7 +38,7 @@ module.exports = merge(common, { ...(useHttps && { server: 'https' }), static: [ { - directory: path.join(__dirname, './build'), + directory: path.join(__dirname, 'build'), }, { directory: path.join(__dirname, './public'), diff --git a/simple/webpack.common.js b/simple/webpack.common.js index b48dd5e..92d6ca4 100644 --- a/simple/webpack.common.js +++ b/simple/webpack.common.js @@ -17,19 +17,19 @@ const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); +const { nvidiaCloudxrWebpackAlias } = require('../webpack-nvidia-cloudxr-alias.cjs'); module.exports = { entry: './src/main.ts', - // Enable webpack 5 persistent filesystem caching for faster incremental builds cache: { type: 'filesystem', + name: 'simple', buildDependencies: { config: [__filename], }, }, - // Module rules define how different file types are processed module: { rules: [ { @@ -40,24 +40,22 @@ module.exports = { ], }, - // Resolve configuration for module resolution resolve: { extensions: ['.ts', '.js'], alias: { - // @helpers can be used instead of relative paths to the helpers directory '@helpers': path.resolve(__dirname, './helpers'), + // If OVERRIDE_CLOUDXR_FILENAME is set (testing only), @nvidia/cloudxr resolves to that bundle + // basename next to package main—not for production. See ../webpack-nvidia-cloudxr-alias.cjs. + ...nvidiaCloudxrWebpackAlias(__dirname), }, }, - // Output configuration for bundled files output: { filename: 'bundle.js', - path: path.resolve(__dirname, './build'), + path: path.resolve(__dirname, 'build'), }, - // Webpack plugins that extend webpack's functionality plugins: [ - // Generates HTML file and automatically injects bundled JavaScript new HtmlWebpackPlugin({ template: './index.html', favicon: './favicon.ico', diff --git a/simple/webpack.dev.js b/simple/webpack.dev.js index 8451914..ce62444 100644 --- a/simple/webpack.dev.js +++ b/simple/webpack.dev.js @@ -38,7 +38,7 @@ module.exports = merge(common, { // Enable HTTPS with self-signed certificate when HTTPS=true ...(useHttps && { server: 'https' }), static: { - directory: path.join(__dirname, './build'), + directory: path.join(__dirname, 'build'), watch: true, }, watchFiles: {