@@ -3,13 +3,16 @@ 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+ .toList
10+ .head
711
8- lazy val scalaJsChrome = ProjectRef (file(" ../. " ), " bindings " )
12+ lazy val examples = project.in (file(" ." )).aggregate(exampleApp, extension )
913
1014lazy val exampleApp = project
1115 .in(file(" app" ))
12- .dependsOn(scalaJsChrome)
1316 .enablePlugins(ChromeSbtPlugin )
1417 .settings(
1518 name := " Example App" ,
@@ -23,12 +26,12 @@ lazy val exampleApp = project
2326 " -Xfatal-warnings" ,
2427 " -feature"
2528 ),
29+ libraryDependencies += " com.alexitc" %%% " scala-js-chrome" % scalajsChromeV,
2630 scalaJSUseMainModuleInitializer := true ,
2731 Test / scalaJSUseMainModuleInitializer := false ,
2832 scalaJSLinkerConfig := scalaJSLinkerConfig.value.withRelativizeSourceMapBase(
2933 Some ((Compile / fastOptJS / artifactPath).value.toURI)
3034 ),
31- packageJSDependencies / skip := false ,
3235 // you can customize and have a static output name for lib and dependencies
3336 // instead of having the default files names like app-fastopt.js, ...
3437 (Compile / fastOptJS / artifactPath) := {
@@ -37,19 +40,13 @@ lazy val exampleApp = project
3740 (Compile / fullOptJS / artifactPath) := {
3841 (fullOptJS / crossTarget).value / " main.js"
3942 },
40- (Compile / packageJSDependencies / artifactPath) := {
41- (packageJSDependencies / crossTarget).value / " dependencies.js"
42- },
43- (Compile / packageMinifiedJSDependencies / artifactPath) := {
44- (packageMinifiedJSDependencies / crossTarget).value / " dependencies.js"
45- },
4643 chromeManifest := new AppManifest {
4744 val name = Keys .name.value
4845 val version = Keys .version.value
4946
5047 val app = App (
5148 background = Background (
52- scripts = List (" main.js" , " dependencies .js" )
49+ scripts = List (" main.js" , " main-bundle .js" )
5350 )
5451 )
5552 override val defaultLocale = Some (" en" )
@@ -72,7 +69,6 @@ lazy val exampleApp = project
7269
7370lazy val extension = project
7471 .in(file(" extension" ))
75- .dependsOn(scalaJsChrome)
7672 .enablePlugins(ChromeSbtPlugin )
7773 .settings(
7874 name := " Example Extension" ,
@@ -86,12 +82,12 @@ lazy val extension = project
8682 " -Xfatal-warnings" ,
8783 " -feature"
8884 ),
85+ libraryDependencies += " com.alexitc" %%% " scala-js-chrome" % scalajsChromeV,
8986 scalaJSUseMainModuleInitializer := true ,
9087 Test / scalaJSUseMainModuleInitializer := false ,
9188 scalaJSLinkerConfig := scalaJSLinkerConfig.value.withRelativizeSourceMapBase(
9289 Some ((Compile / fastOptJS / artifactPath).value.toURI)
9390 ),
94- packageJSDependencies / skip := false ,
9591 // you can customize and have a static output name for lib and dependencies
9692 // instead of having the default files names like extension-fastopt.js, ...
9793 (Compile / fastOptJS / artifactPath) := {
@@ -100,16 +96,10 @@ lazy val extension = project
10096 (Compile / fullOptJS / artifactPath) := {
10197 (fullOptJS / crossTarget).value / " main.js"
10298 },
103- (Compile / packageJSDependencies / artifactPath) := {
104- (packageJSDependencies / crossTarget).value / " dependencies.js"
105- },
106- (Compile / packageMinifiedJSDependencies / artifactPath) := {
107- (packageMinifiedJSDependencies / crossTarget).value / " dependencies.js"
108- },
10999 chromeManifest := new ExtensionManifest {
110100
111101 val background = Background (
112- scripts = List (" main.js" , " dependencies .js" )
102+ scripts = List (" main.js" , " main-bundle .js" )
113103 )
114104 val name = Keys .name.value
115105 val version = Keys .version.value
0 commit comments