@@ -3,13 +3,15 @@ import chrome.permissions.Permission
33import chrome .permissions .Permission .{API , Host }
44import com .alexitc .{Chrome , ChromeSbtPlugin }
55
6- lazy val examples = project.in(file(" ." )).aggregate(exampleApp, extension)
6+ lazy val scalajsChromeV = scala.io.Source
7+ .fromInputStream(getClass.getClassLoader.getResourceAsStream(" /version.txt" ))
8+ .getLines()
9+ .head
710
8- lazy val scalaJsChrome = ProjectRef (file(" ../. " ), " bindings " )
11+ lazy val examples = project.in (file(" ." )).aggregate(exampleApp, extension )
912
1013lazy val exampleApp = project
1114 .in(file(" app" ))
12- .dependsOn(scalaJsChrome)
1315 .enablePlugins(ChromeSbtPlugin )
1416 .settings(
1517 name := " Example App" ,
@@ -23,12 +25,12 @@ lazy val exampleApp = project
2325 " -Xfatal-warnings" ,
2426 " -feature"
2527 ),
28+ libraryDependencies += " com.alexitc" %%% " scala-js-chrome" % scalajsChromeV,
2629 scalaJSUseMainModuleInitializer := true ,
2730 Test / scalaJSUseMainModuleInitializer := false ,
2831 scalaJSLinkerConfig := scalaJSLinkerConfig.value.withRelativizeSourceMapBase(
2932 Some ((Compile / fastOptJS / artifactPath).value.toURI)
3033 ),
31- packageJSDependencies / skip := false ,
3234 // you can customize and have a static output name for lib and dependencies
3335 // instead of having the default files names like app-fastopt.js, ...
3436 (Compile / fastOptJS / artifactPath) := {
@@ -37,19 +39,13 @@ lazy val exampleApp = project
3739 (Compile / fullOptJS / artifactPath) := {
3840 (fullOptJS / crossTarget).value / " main.js"
3941 },
40- (Compile / packageJSDependencies / artifactPath) := {
41- (packageJSDependencies / crossTarget).value / " dependencies.js"
42- },
43- (Compile / packageMinifiedJSDependencies / artifactPath) := {
44- (packageMinifiedJSDependencies / crossTarget).value / " dependencies.js"
45- },
4642 chromeManifest := new AppManifest {
4743 val name = Keys .name.value
4844 val version = Keys .version.value
4945
5046 val app = App (
5147 background = Background (
52- scripts = List (" main.js" , " dependencies .js" )
48+ scripts = List (" main.js" , " main-bundle .js" )
5349 )
5450 )
5551 override val defaultLocale = Some (" en" )
@@ -72,7 +68,6 @@ lazy val exampleApp = project
7268
7369lazy val extension = project
7470 .in(file(" extension" ))
75- .dependsOn(scalaJsChrome)
7671 .enablePlugins(ChromeSbtPlugin )
7772 .settings(
7873 name := " Example Extension" ,
@@ -86,12 +81,12 @@ lazy val extension = project
8681 " -Xfatal-warnings" ,
8782 " -feature"
8883 ),
84+ libraryDependencies += " com.alexitc" %%% " scala-js-chrome" % scalajsChromeV,
8985 scalaJSUseMainModuleInitializer := true ,
9086 Test / scalaJSUseMainModuleInitializer := false ,
9187 scalaJSLinkerConfig := scalaJSLinkerConfig.value.withRelativizeSourceMapBase(
9288 Some ((Compile / fastOptJS / artifactPath).value.toURI)
9389 ),
94- packageJSDependencies / skip := false ,
9590 // you can customize and have a static output name for lib and dependencies
9691 // instead of having the default files names like extension-fastopt.js, ...
9792 (Compile / fastOptJS / artifactPath) := {
@@ -100,16 +95,10 @@ lazy val extension = project
10095 (Compile / fullOptJS / artifactPath) := {
10196 (fullOptJS / crossTarget).value / " main.js"
10297 },
103- (Compile / packageJSDependencies / artifactPath) := {
104- (packageJSDependencies / crossTarget).value / " dependencies.js"
105- },
106- (Compile / packageMinifiedJSDependencies / artifactPath) := {
107- (packageMinifiedJSDependencies / crossTarget).value / " dependencies.js"
108- },
10998 chromeManifest := new ExtensionManifest {
11099
111100 val background = Background (
112- scripts = List (" main.js" , " dependencies .js" )
101+ scripts = List (" main.js" , " main-bundle .js" )
113102 )
114103 val name = Keys .name.value
115104 val version = Keys .version.value
0 commit comments