From 047449e7cc43616850dbcdc9abfc2c48e172b79b Mon Sep 17 00:00:00 2001 From: Carlos Quiroz Date: Fri, 14 Aug 2020 10:22:27 -0400 Subject: [PATCH] Update static test Signed-off-by: Carlos Quiroz --- .../sbt-scalajs-bundler/static/build.sbt | 8 ++++---- .../static/index-prod.html | 4 ++-- .../sbt-scalajs-bundler/static/index.html | 4 ++-- .../static/prod.webpack.config.js | 8 +++----- .../sbt-test/sbt-scalajs-bundler/static/test | 20 +++++++++---------- 5 files changed, 21 insertions(+), 23 deletions(-) diff --git a/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/build.sbt b/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/build.sbt index 5ed10db9..d43432be 100644 --- a/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/build.sbt +++ b/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/build.sbt @@ -2,7 +2,7 @@ name := "static" enablePlugins(ScalaJSBundlerPlugin, ScalaJSJUnitPlugin) -scalaVersion := "2.11.12" +scalaVersion := "2.13.3" scalaJSUseMainModuleInitializer := true @@ -10,8 +10,6 @@ libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "1.0.0" npmDependencies in Compile += "snabbdom" -> "0.5.3" -npmDevDependencies in Compile += "uglifyjs-webpack-plugin" -> "1.2.2" - // Use a different Webpack configuration file for production webpackConfigFile in fullOptJS := Some(baseDirectory.value / "prod.webpack.config.js") @@ -20,6 +18,8 @@ requireJsDomEnv in Test := true version in installJsdom := "16.2.0" +version in webpack := "4.44.1" + webpackBundlingMode := BundlingMode.LibraryAndApplication() useYarn := true @@ -50,7 +50,7 @@ TaskKey[Unit]("checkSize") := { val artifactSize = IO.readBytes(bundleFile).length val sizeLow = 17000 - val sizeHigh = 22000 + val sizeHigh = 29000 // Account for minor variance in size due to transitive dependency updates assert( diff --git a/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/index-prod.html b/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/index-prod.html index 2813a14f..8de82c35 100644 --- a/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/index-prod.html +++ b/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/index-prod.html @@ -5,6 +5,6 @@
- + - \ No newline at end of file + diff --git a/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/index.html b/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/index.html index e1fb9a8f..af543f84 100644 --- a/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/index.html +++ b/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/index.html @@ -5,6 +5,6 @@
- + - \ No newline at end of file + diff --git a/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/prod.webpack.config.js b/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/prod.webpack.config.js index 8f14d075..463e1864 100644 --- a/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/prod.webpack.config.js +++ b/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/prod.webpack.config.js @@ -1,7 +1,5 @@ -var UglifyJsPlugin = require("uglifyjs-webpack-plugin"); - module.exports = require("./scalajs.webpack.config"); -module.exports.plugins = (module.exports.plugins || []).concat([ - new UglifyJsPlugin({ sourceMap: module.exports.devtool === "source-map" }) -]); +module.exports.optimization = { + minimize: true, +}; diff --git a/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/test b/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/test index 8b5742ad..1f2aefcc 100644 --- a/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/test +++ b/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static/test @@ -1,11 +1,11 @@ -$ absent target/scala-2.11/scalajs-bundler/main/static-fastopt-bundle.js target/scala-2.11/scalajs-bundler/main/static-fastopt-bundle.js.map +$ absent target/scala-2.13/scalajs-bundler/main/static-fastopt-bundle.js target/scala-2.13/scalajs-bundler/main/static-fastopt-bundle.js.map > fastOptJS::webpack -$ exists target/scala-2.11/scalajs-bundler/main/static-fastopt-bundle.js target/scala-2.11/scalajs-bundler/main/static-fastopt-bundle.js.map +$ exists target/scala-2.13/scalajs-bundler/main/static-fastopt-bundle.js target/scala-2.13/scalajs-bundler/main/static-fastopt-bundle.js.map > html index.html -$ absent target/scala-2.11/scalajs-bundler/main/static-opt-bundle.js target/scala-2.11/scalajs-bundler/main/static-opt-bundle.js.map +$ absent target/scala-2.13/scalajs-bundler/main/static-opt-bundle.js target/scala-2.13/scalajs-bundler/main/static-opt-bundle.js.map > fullOptJS::webpack -$ exists target/scala-2.11/scalajs-bundler/main/static-opt-bundle.js target/scala-2.11/scalajs-bundler/main/static-opt-bundle.js.map +$ exists target/scala-2.13/scalajs-bundler/main/static-opt-bundle.js target/scala-2.13/scalajs-bundler/main/static-opt-bundle.js.map > html index-prod.html > checkSize @@ -14,9 +14,9 @@ $ exists target/scala-2.11/scalajs-bundler/main/static-opt-bundle.js target/scal > clean > set scalaJSLinkerConfig := scalaJSLinkerConfig.value.withSourceMap(false) > fastOptJS::webpack -$ absent target/scala-2.11/scalajs-bundler/main/static-fastopt-bundle.js.map +$ absent target/scala-2.13/scalajs-bundler/main/static-fastopt-bundle.js.map > fullOptJS::webpack -$ absent target/scala-2.11/scalajs-bundler/main/static-opt-bundle.js.map +$ absent target/scala-2.13/scalajs-bundler/main/static-opt-bundle.js.map # webpackEmitSourceMaps controls source maps emission for the webpack task @@ -24,12 +24,12 @@ $ absent target/scala-2.11/scalajs-bundler/main/static-opt-bundle.js.map > set scalaJSLinkerConfig := scalaJSLinkerConfig.value.withSourceMap(true) > set webpackEmitSourceMaps in (Compile, fastOptJS) := false > fastOptJS::webpack -$ exists target/scala-2.11/scalajs-bundler/main/static-fastopt.js.map -$ absent target/scala-2.11/scalajs-bundler/main/static-fastopt-bundle.js.map +$ exists target/scala-2.13/scalajs-bundler/main/static-fastopt.js.map +$ absent target/scala-2.13/scalajs-bundler/main/static-fastopt-bundle.js.map > set webpackEmitSourceMaps in (Compile, fullOptJS) := false > fullOptJS::webpack -$ exists target/scala-2.11/scalajs-bundler/main/static-opt.js.map -$ absent target/scala-2.11/scalajs-bundler/main/static-opt-bundle.js.map +$ exists target/scala-2.13/scalajs-bundler/main/static-opt.js.map +$ absent target/scala-2.13/scalajs-bundler/main/static-opt-bundle.js.map > test