Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

buildStatic and Conditional Substitions with rollup enable in jspm@beta #549

Closed

Description

@fchiumeo

Hello
When I try to compile using conditions substitions and rollup enabled the javascript output is not generated successfully

jspm.config.js

SystemJS.config({
    transpiler: "plugin-babel",
    babelOptions: {
        "plugins": [
            "babel-plugin-transform-decorators-legacy"
        ]
    }, 
    map: {
        "condiciones": "app/core/config/entorno.condiciones.js"
    }
});

config.js

import "./config.#{condiciones|entorno}.js";

class OnConfig
{}

entorno.condiciones.js

export var entorno = "desarrollo";

bundle

 const outputOptions = {
        conditions: {
             "app/core/config/entorno.condiciones.js|entorno": entorno.toLocaleLowerCase()
        }
    };

    new jspm.Builder().buildStatic("app/main.js", "bundle.js",outputOptions)
        .then(() =>
        {
            log.info(chalk.blue("Generación de javascript completada con éxito."));
            callback();
        })
        .catch((ex) =>
        {
            log.error(chalk.red("Fallo la generación."));
            throw ex;
        });

bundle.js

(["1","@dummy-entry-point"], [], function($__System) {

......

$__System.register("@dummy-entry-point", ["3", "2", "4"], function($__export) {
  "use strict";

.....

console error
uncaught exception: Module 1 not present.

disable rollup en outputOptions(rollup: false) bundle.js is ok

bundle.js

(["1","2"], [], function($__System) {

......

$__System.register("1", ["4", "3", "5", "7"], function($__export) {
  "use strict";

.....

$__System.register("2", [], function($__export) {
  "use strict";
.....

I'm using jspm 0.17.0-beta.13

Activity

  1. guybedford commented on Apr 16, 2016

    @guybedford
    Member

    This may have been fixed in 104ff4f.

  2. fchiumeo commented on Apr 17, 2016

    @fchiumeo
    Author

    not working yet 😢

  3. guybedford commented on Apr 22, 2016

    @guybedford
    Member

    I can get this to work fine in jspm 0.17.0-beta.13 with:

    jspm build app/main.js bundle.js --conditions "{'app/core/config/entorno.conditiones.js|entorno':'value'}"
    

    Let me know if you're still having issues here.

  4. fchiumeo commented on Apr 22, 2016

    @fchiumeo
    Author

    same error, not working with command and gulp task

  5. guybedford commented on Apr 22, 2016

    @guybedford
    Member

    @fchiumeo can you perhaps share a full replication then? Also please confirm you're definitely running the latest beta.

  6. fchiumeo commented on Apr 22, 2016

    @fchiumeo
    Author

    fchiumeo/app-jspm
    i'm testing on jspm 0.17 beta 13 and systemjs/builder#master

  7. guybedford commented on Apr 22, 2016

    @guybedford
    Member

    Ok thanks, this actually has nothing to do with the conditional side of things, it's a bug with the rollup optimization process. I'm looking into it.

  8. guybedford commented on Apr 22, 2016

    @guybedford
    Member

    Thanks for the test case, fixed in 548879c.

  9. fchiumeo commented on Apr 23, 2016

    @fchiumeo
    Author

    now working fine
    very thanks

  10. guybedford commented on Apr 29, 2016

    @guybedford
    Member

    Released in 0.15.16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions