Giter Site home page Giter Site logo

sbt-babel's People

Contributors

janwillemvd avatar juanmirocks avatar zenato avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sbt-babel's Issues

Update to use Babel 7

Can have an update from 'babel-core' to '@babel/core'
Kindly let me know how in can help though am not well conversant with scala.

babel-core not found despite the fact its globally installed

Hi there
I am working in a Windows10 environment and unfortunately, this plugin doesn't seem to work :-/
When try to create the assets using play, I get the following error:

(Server started, use Ctrl+D to stop and go back to the console...)

[info] Babel compiling on 4 source(s)
[error] module.js:338
[error] throw err;
[error] ^
[error] Error: Cannot find module 'babel-core'
[error] at Function.Module._resolveFilename (module.js:336:15)
[error] at Function.Module._load (module.js:278:25)
[error] at Module.require (module.js:365:17)
[error] at require (module.js:384:17)
[error] at Object. (C:\Projekte\Privat\betterdating\htdocs\project\target\babel\sbt-babel-1.0.1.jar:8:9)
[error] at Module._compile (module.js:460:26)
[error] at Object.Module._extensions..js (module.js:478:10)
[error] at Module.load (module.js:355:32)
[error] at Function.Module._load (module.js:310:12)
[error] at Function.Module.runMain (module.js:501:10)
[error] module.js:338
[error] throw err;

Of course one would think that the problem is that the babel-core npm module isn't installed, but it actually is:

When I type "npm list -g babel-core" in a terminal, I get the following result:
C:\Users\sam\AppData\Roaming\npm
└── [email protected]

Are there any known issues?

Best regards
Samuel

unresolved dependency: com.typesafe#jstranspiler;1.0.0

Hello,

when I add the dependency

addSbtPlugin("io.teamscala.sbt" % "sbt-babel" % "1.0.2")

to the plugins.sbt of my Play Framework app, the whole SBT project becomes unloadable, failing with the following message:

[info] Resolving com.typesafe#jstranspiler;1.0.0 ...
[warn]  module not found: com.typesafe#jstranspiler;1.0.0
[warn] ==== typesafe-ivy-releases: tried
[warn]   https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe/jstranspiler/1.0.0/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn]   https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe/jstranspiler/1.0.0/ivys/ivy.xml
[warn] ==== local: tried
[warn]   /Users/xwinus/.ivy2/local/com.typesafe/jstranspiler/1.0.0/ivys/ivy.xml
[warn] ==== jcenter: tried
[warn]   https://jcenter.bintray.com/com/typesafe/jstranspiler/1.0.0/jstranspiler-1.0.0.pom
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/com/typesafe/jstranspiler/1.0.0/jstranspiler-1.0.0.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe#jstranspiler;1.0.0: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

....

[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe#jstranspiler;1.0.0: not found
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 

I noticed this dependency is available via the Typesafe Maven Releases Repository (https://repo.typesafe.com/typesafe/maven-releases/), isn't the following repository declaration:

resolvers += "Typesafe Releases Repository" at "https://repo.typesafe.com/typesafe/maven-releases/"

missing in your build.sb file?

EDIT1: I noticed you have the

    resolvers += Resolver.typesafeRepo("releases"),

definition present, which should allow SBT to resolve the correct repository, but unfortunately it is not working for me.

Tested on SBT 0.13.8, Scala 2.11.6

Thanks

use a JVM JS engine

It would be nice if node wouldn't be a dependency. Could the plugin be made to use Trireme or Rhino instead? What would be necessary changes for that?

Import not getting dependencies

Hi,

Am using this plugin to compile my react modules to umd module but my imports are not resolving.
This is the error i get in the case below.

Uncaught TypeError: Cannot read property 'Component' of undefined


Here is my .babelrc

{
  "presets": ["es2015", "stage-0", "react"],
  "plugins": ["transform-es2015-modules-umd", "transform-react-jsx"]
}

Here is my module

import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import {Button, Checkbox, Form} from 'semantic-ui-react';

export default class Login extends React.Component {
        render () {
            return (
                <div className="ui middle aligned center aligned grid">
                    <div className="column">
                        <h2 className="ui image header">
                          Login
                        </h2>
                    </div>
                </div>
            );
        }
    }

ReactDOM.render(<Login/>, document.getElementById('content'));

------
Here is the compiled code

(function (global, factory) {
    if (typeof define === "function" && define.amd) {
        define(['exports', 'react', 'react-dom', 'semantic-ui-react'], factory);
    } else if (typeof exports !== "undefined") {
        factory(exports, require('react'), require('react-dom'), require('semantic-ui-react'));
    } else {
        var mod = {
            exports: {}
        };
        factory(mod.exports, global.react, global.reactDom, global.semanticUiReact);
        global.login = mod.exports;
    }
})(this, function (exports, _react, _reactDom, _semanticUiReact) {
    'use strict';

    Object.defineProperty(exports, "__esModule", {
        value: true
    });

    var _react2 = _interopRequireDefault(_react);

    var _reactDom2 = _interopRequireDefault(_reactDom);

    function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : {
            default: obj
        };
    }

    function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
        }
    }

    var _createClass = function () {
        function defineProperties(target, props) {
            for (var i = 0; i < props.length; i++) {
                var descriptor = props[i];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor) descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
            }
        }

        return function (Constructor, protoProps, staticProps) {
            if (protoProps) defineProperties(Constructor.prototype, protoProps);
            if (staticProps) defineProperties(Constructor, staticProps);
            return Constructor;
        };
    }();

    function _possibleConstructorReturn(self, call) {
        if (!self) {
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }

        return call && (typeof call === "object" || typeof call === "function") ? call : self;
    }

    function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
            throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
        }

        subClass.prototype = Object.create(superClass && superClass.prototype, {
            constructor: {
                value: subClass,
                enumerable: false,
                writable: true,
                configurable: true
            }
        });
        if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
    }

    var Login = function (_React$Component) {
        _inherits(Login, _React$Component);

        function Login() {
            _classCallCheck(this, Login);

            return _possibleConstructorReturn(this, (Login.__proto__ || Object.getPrototypeOf(Login)).apply(this, arguments));
        }

        _createClass(Login, [{
            key: 'render',
            value: function render() {
                return _react2.default.createElement(
                    'div',
                    { className: 'ui middle aligned center aligned grid' },
                    _react2.default.createElement(
                        'div',
                        { className: 'column' },
                        _react2.default.createElement(
                            'h2',
                            { className: 'ui image header' },
                            'Login'
                        )
                    )
                );
            }
        }]);

        return Login;
    }(_react2.default.Component);

    exports.default = Login;


    _reactDom2.default.render(_react2.default.createElement(Login, null), document.getElementById('content'));
});

How can I add this to the pipeline?

How can I use it in this pipeline?
pipelineStages := Seq(rjs, gzip)

Also, where should I declare any input for the plugin?
lazy val root = (project in file(".")).enablePlugins(SbtWeb) - is this the target folder declaration?

Problems using plugin with sbt-rjs

Is it possible to use this plugin with other SbtWeb plugins? My requirejs build fails because this plugin has not run yet (I use pipelineStages := Seq(rjs, digest, gzip)). Can I somehow include this plugin into the pipeline?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.