From 35fc7a70426167d457ad0d09a62212b614e7ef15 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Tue, 17 Jan 2023 19:20:48 +0300 Subject: [PATCH] Update threejs server --- build.gradle.kts | 2 +- .../build.gradle.kts | 12 +++++++--- .../kscience/visionforge/three/jsMain.kt | 4 ++-- .../webpack.config.d/01.ring.js | 23 +++++++++++++++++++ .../webpack.config.d/02.bundle.js | 10 ++++++++ 5 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 visionforge-threejs/visionforge-threejs-server/webpack.config.d/01.ring.js create mode 100644 visionforge-threejs/visionforge-threejs-server/webpack.config.d/02.bundle.js diff --git a/build.gradle.kts b/build.gradle.kts index 5a82b18c..c9ee8e6d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,7 @@ val fxVersion by extra("11") allprojects { group = "space.kscience" - version = "0.3.0-dev-5" + version = "0.3.0-dev-7" } subprojects { diff --git a/visionforge-threejs/visionforge-threejs-server/build.gradle.kts b/visionforge-threejs/visionforge-threejs-server/build.gradle.kts index 7623086d..d3ef8496 100644 --- a/visionforge-threejs/visionforge-threejs-server/build.gradle.kts +++ b/visionforge-threejs/visionforge-threejs-server/build.gradle.kts @@ -10,6 +10,11 @@ kotlin { webpackTask { this.outputFileName = "js/visionforge-three.js" } + commonWebpackConfig { + cssSupport{ + enabled.set(false) + } + } } binaries.executable() } @@ -17,17 +22,18 @@ kotlin { sourceSets { commonMain { dependencies { - api(project(":visionforge-solid")) + api(projects.visionforgeSolid) } } jvmMain { dependencies { - api(project(":visionforge-server")) + api(projects.visionforgeServer) } } jsMain { dependencies { - api(project(":visionforge-threejs")) + api(projects.visionforgeThreejs) + api(projects.ui.ring) } } } diff --git a/visionforge-threejs/visionforge-threejs-server/src/jsMain/kotlin/space/kscience/visionforge/three/jsMain.kt b/visionforge-threejs/visionforge-threejs-server/src/jsMain/kotlin/space/kscience/visionforge/three/jsMain.kt index ed2908f5..d1635ddf 100644 --- a/visionforge-threejs/visionforge-threejs-server/src/jsMain/kotlin/space/kscience/visionforge/three/jsMain.kt +++ b/visionforge-threejs/visionforge-threejs-server/src/jsMain/kotlin/space/kscience/visionforge/three/jsMain.kt @@ -1,11 +1,11 @@ package space.kscience.visionforge.three import space.kscience.dataforge.misc.DFExperimental +import space.kscience.visionforge.ring.ThreeWithControlsPlugin import space.kscience.visionforge.runVisionClient -import space.kscience.visionforge.solid.three.ThreePlugin @DFExperimental public fun main(): Unit = runVisionClient { - plugin(ThreePlugin) + plugin(ThreeWithControlsPlugin) } \ No newline at end of file diff --git a/visionforge-threejs/visionforge-threejs-server/webpack.config.d/01.ring.js b/visionforge-threejs/visionforge-threejs-server/webpack.config.d/01.ring.js new file mode 100644 index 00000000..b3cc4770 --- /dev/null +++ b/visionforge-threejs/visionforge-threejs-server/webpack.config.d/01.ring.js @@ -0,0 +1,23 @@ +const ringConfig = require('@jetbrains/ring-ui/webpack.config').config; +const path = require('path'); + +config.module.rules.push(...ringConfig.module.rules) + +config.module.rules.push( + { + test: /\.css$/, + exclude: [ + path.resolve(__dirname, "../../node_modules/@jetbrains/ring-ui") + ], + use: [ + { + loader: 'style-loader', + options: {} + }, + { + loader: 'css-loader', + options: {} + } + ] + } +) \ No newline at end of file diff --git a/visionforge-threejs/visionforge-threejs-server/webpack.config.d/02.bundle.js b/visionforge-threejs/visionforge-threejs-server/webpack.config.d/02.bundle.js new file mode 100644 index 00000000..947253ca --- /dev/null +++ b/visionforge-threejs/visionforge-threejs-server/webpack.config.d/02.bundle.js @@ -0,0 +1,10 @@ +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; + +module.exports = { + plugins: [ + new BundleAnalyzerPlugin({ + analyzerMode: "static", + reportFilename: "bundle-report.html" + }) + ] +} \ No newline at end of file