🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

angulate2-scalajs-bundler

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angulate2-scalajs-bundler

Simplyfies the usage of angulate2 with the scalajs-bundler

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
3
-86.36%
Maintainers
1
Weekly downloads
 
Created
Source

angulate2-scalajs-bundler

Simplyfies the usage of angulate2 with the scalajs-bundler

Usage:

  • Create a scalajs project https://www.scala-js.org/tutorial/basic/
  • Add scalajs-bundler to your project: https://scalacenter.github.io/scalajs-bundler/getting-started.html
  • Add angulate2 to your Project: https://github.com/jokade/angulate2. You have to skip the section Build and run with System.js
  • Add the angular2 dependencies to your build.sbt:
npmDependencies in Compile += "@angular/common" -> "~2.4.0"
npmDependencies in Compile += "@angular/compiler" -> "~2.4.0"
npmDependencies in Compile += "@angular/core" -> "~2.4.0"
npmDependencies in Compile += "@angular/forms" -> "~2.4.0"
npmDependencies in Compile += "@angular/http" -> "~2.4.0"
npmDependencies in Compile += "@angular/platform-browser" -> "~2.4.0"
npmDependencies in Compile += "@angular/platform-browser-dynamic" -> "~2.4.0"
npmDependencies in Compile += "@angular/router" -> "~3.4.0"
npmDependencies in Compile += "@angular/upgrade" -> "~2.4.0"
npmDependencies in Compile += "core-js" -> "~2.4.1"
npmDependencies in Compile += "rxjs" -> "~5.0.1"
npmDependencies in Compile += "zone.js" -> "0.7.4"
  • Add angulate2-scalajs-bundler as development dependency to your project:
npmDevDependencies in Compile += "angulate2-scalajs-bundler" -> "1.0.3"
  • Add a webpack.config.js to your project root:
angulate2ScalaJsBundler = require("angulate2-scalajs-bundler");
module.exports = require('./scalajs.webpack.config');
module.exports.context = __dirname;
angulate2ScalaJsBundler.apply("your-sbt-project-name", module);

  • Tell scalajs-bundler to use your webpack config, add this line to your build.sbt:
webpackConfigFile in fastOptJS := Some(baseDirectory.value  / "webpack.config.js")
  • Add a folder called web to yor project root which has at least to contain a index.html, in which you reference any css file you want to use, e.g:
<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>Title</title>
   <link rel="stylesheet" href="./styles/main.css">
</head>
<body>
   <app></app><!--Component selector-->
</body>
</html>
  • Run fastOptJS::webpack your bundled files should appear at project-root/target/scala-{version}/scalajs-bundler/main/dist

Keywords

scalajs

FAQs

Package last updated on 25 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts