aurelia / bundler

A library for bundling JavaScript, HTML and CSS for use with SystemJS.
MIT License
37 stars 25 forks source link

Aurelia bundeling of files with text plugin results in System JS not being able to find the files in the bundle #95

Closed ghost closed 8 years ago

ghost commented 8 years ago

When using the SystemJS text plugin for bundeling .html and .css files, the aurelia bundler compiles the bundled files with references to text files inside the bundle like this:

(function() {
var define = System.amdDefine;
define("github:necolas/normalize.css@3.0.3/normalize.css!github:systemjs/plugin-text@0.0.7.js", [], function() {
  return <TEXT HERE>;
});

However, as soon as SystemJS configures itself (at line 1804 of system.js), it decanonicalizes the bundle dependencies (at line 1902: var normalizedBundleDep = loader.decanonicalize(cfg.bundles[p][i]);)

However, this causes SystemJS to register the above dependency in its loader bundle as:

http://localhost:9000/jspm_packages/github/necolas/normalize.css@3.0.3/normalize.css!http://localhost:9000/jspm_packages/github/systemjs/plugin-text@0.0.7.js

Adding the entire "http://localhost....." bit to the text plugin bit which is not present in the actual bundle .js file, causing the lookup of the file to fail.

Any idea how to fix this?

EisenbergEffect commented 8 years ago

@ahmedshuhel Please take a look. Thanks!

ghost commented 8 years ago

Did you have a chance to look at this? I can't figure out what the (critial) difference is between my config and the template. Do you need some more informatio perhaps?

ahmedshuhel commented 8 years ago

@MaartenThomassen Which version of SystemJS are you using? Can you post the config.js and package.json file. A demo app demonstrating this problem on github will be a great help to find out the real issue.

ghost commented 8 years ago

@ahmedshuhel Sorry for not getting back to you on this sooner, we've had a busy week last week and I havn't had time to look at the issue. For now, we've released internally without bundling and with a few tweaks to our server file settings things are going OK now, though we would really like to get bundling going for the public release of our app.

As for your questions:

JSPM: 0.16.31 SystemJS: v0.19.24

package.json:

"devDependencies": {
    "aurelia-bundler": "^0.3.2",
    "aurelia-tools": "^0.1.3",
    "browser-sync": "^2.11.1",
    "del": "^1.1.0",
    "ftp": "^0.3.10",
    "gulp": "^3.8.10",
    "gulp-add-src": "^0.2.0",
    "gulp-bump": "^0.3.1",
    "gulp-changed": "^1.1.0",
    "gulp-confirm": "^1.0.4",
    "gulp-debug": "^2.1.2",
    "gulp-notify": "^2.2.0",
    "gulp-plumber": "^1.0.1",
    "gulp-rename": "^1.2.2",
    "gulp-replace": "^0.5.4",
    "gulp-sass": "^2.2.0",
    "gulp-sourcemaps": "^1.3.0",
    "gulp-template": "^3.1.0",
    "gulp-typescript": "^2.12.1",
    "gulp-util": "^3.0.7",
    "jspm": "^0.16.31",
    "object.assign": "^1.0.3",
    "require-dir": "^0.1.0",
    "run-sequence": "^1.0.2",
    "vinyl-ftp": "^0.4.5",
    "vinyl-paths": "^1.0.0",
    "yargs": "^2.1.1"
  },
  "jspm": {
    "dependencies": {
      "aurelia-animator-css": "npm:aurelia-animator-css@^1.0.0-beta.1.1.2",
      "aurelia-binding": "npm:aurelia-binding@^1.0.0-beta.1.2.2",
      "aurelia-bootstrapper": "npm:aurelia-bootstrapper@^1.0.0-beta.1.1.4",
      "aurelia-dependency-injection": "npm:aurelia-framework@^1.0.0-beta.1.1.4",
      "aurelia-event-aggregator": "npm:aurelia-event-aggregator@^1.0.0-beta.1.1.1",
      "aurelia-history": "npm:aurelia-history@^1.0.0-beta.1.1.1",
      "aurelia-history-browser": "npm:aurelia-history-browser@^1.0.0-beta.1.1.4",
      "aurelia-http-client": "npm:aurelia-http-client@^1.0.0-beta.1.1.2",
      "aurelia-loader": "npm:aurelia-loader@^1.0.0-beta.1.1.1",
      "aurelia-loader-default": "npm:aurelia-loader-default@^1.0.0-beta.1.1.3",
      "aurelia-logging": "npm:aurelia-logging@^1.0.0-beta.1.1.2",
      "aurelia-metadata": "npm:aurelia-metadata@^1.0.0-beta.1.1.6",
      "aurelia-pal": "npm:aurelia-pal@^1.0.0-beta.1.1.1",
      "aurelia-pal-browser": "npm:aurelia-pal-browser@^1.0.0-beta.1.1.4",
      "aurelia-path": "npm:aurelia-path@^1.0.0-beta.1.1.1",
      "aurelia-route-recognizer": "npm:aurelia-route-recognizer@^1.0.0-beta.1.1.3",
      "aurelia-router": "npm:aurelia-router@^1.0.0-beta.1.1.3",
      "aurelia-task-queue": "npm:aurelia-task-queue@^1.0.0-beta.1.1.1",
      "aurelia-templating": "npm:aurelia-templating@^1.0.0-beta.1.1.2",
      "aurelia-templating-binding": "npm:aurelia-templating-binding@^1.0.0-beta.1.1.2",
      "aurelia-templating-resources": "npm:aurelia-templating-resources@^1.0.0-beta.1.1.2",
      "aurelia-templating-router": "npm:aurelia-templating-router@^1.0.0-beta.1.1.2",
      "bootstrap": "github:twbs/bootstrap@^3.3.6",
      "core-js": "npm:core-js@^2.1.3",
      "d3": "npm:d3@^3.5.16",
      "font-awesome": "npm:font-awesome@^4.5.0",
      "jquery": "npm:jquery@^2.2.1",
      "moment": "npm:moment@^2.12.0",
      "normalize.css": "github:necolas/normalize.css@^3.0.3",
      "numeral": "npm:numeral@^1.5.3",
      "plottable": "github:palantir/plottable@^1.11.0",
      "text": "github:systemjs/plugin-text@^0.0.7",
      "underscore": "npm:underscore@^1.8.3"
    },
    "devDependencies": {
      "-a": "npm:babel-core@^5.8.24",
      "-a-runtime": "npm:babel-runtime@^5.8.24",
      "typescript": "npm:typescript@^1.8.7"
    }
  }

config.js:

  defaultJSExtensions: true,
  transpiler: false,
  paths: {
    "*": "dist/*",
    "github:*": "jspm_packages/github/*",
    "npm:*": "jspm_packages/npm/*"
  },
  map: {
    "-a": "npm:babel-core@5.8.35",
    "-a-runtime": "npm:babel-runtime@5.8.35",
    "aurelia-animator-css": "npm:aurelia-animator-css@1.0.0-beta.1.1.2",
    "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.2.2",
    "aurelia-bootstrapper": "npm:aurelia-bootstrapper@1.0.0-beta.1.1.4",
    "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.1.4",
    "aurelia-event-aggregator": "npm:aurelia-event-aggregator@1.0.0-beta.1.1.1",
    "aurelia-framework": "npm:aurelia-framework@1.0.0-beta.1.1.4",
    "aurelia-history": "npm:aurelia-history@1.0.0-beta.1.1.1",
    "aurelia-history-browser": "npm:aurelia-history-browser@1.0.0-beta.1.1.4",
    "aurelia-http-client": "npm:aurelia-http-client@1.0.0-beta.1.1.2",
    "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.1.1",
    "aurelia-loader-default": "npm:aurelia-loader-default@1.0.0-beta.1.1.3",
    "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.1.2",
    "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.1.6",
    "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1",
    "aurelia-pal-browser": "npm:aurelia-pal-browser@1.0.0-beta.1.1.4",
    "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.1.1",
    "aurelia-route-recognizer": "npm:aurelia-route-recognizer@1.0.0-beta.1.1.3",
    "aurelia-router": "npm:aurelia-router@1.0.0-beta.1.1.3",
    "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.1.1",
    "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.1.2",
    "aurelia-templating-binding": "npm:aurelia-templating-binding@1.0.0-beta.1.1.2",
    "aurelia-templating-resources": "npm:aurelia-templating-resources@1.0.0-beta.1.1.2",
    "aurelia-templating-router": "npm:aurelia-templating-router@1.0.0-beta.1.1.2",
    "bootstrap": "github:twbs/bootstrap@3.3.6",
    "core-js": "npm:core-js@2.1.3",
    "d3": "npm:d3@3.5.16",
    "font-awesome": "npm:font-awesome@4.5.0",
    "jquery": "npm:jquery@2.2.1",
    "moment": "npm:moment@2.12.0",
    "normalize.css": "github:necolas/normalize.css@3.0.3",
    "numeral": "npm:numeral@1.5.3",
    "plottable": "github:palantir/plottable@1.16.2",
    "text": "github:systemjs/plugin-text@0.0.7",
    "typescript": "npm:typescript@1.8.7",
    "underscore": "npm:underscore@1.8.3",
    "github:jspm/nodelibs-assert@0.1.0": {
      "assert": "npm:assert@1.3.0"
    },
    "github:jspm/nodelibs-path@0.1.0": {
      "path-browserify": "npm:path-browserify@0.0.0"
    },
    "github:jspm/nodelibs-process@0.1.2": {
      "process": "npm:process@0.11.2"
    },
    "github:jspm/nodelibs-util@0.1.0": {
      "util": "npm:util@0.10.3"
    },
    "github:necolas/normalize.css@3.0.3": {
      "css": "github:systemjs/plugin-css@0.1.20"
    },
    "github:twbs/bootstrap@3.3.6": {
      "jquery": "github:components/jquery@2.2.1"
    },
    "npm:assert@1.3.0": {
      "util": "npm:util@0.10.3"
    },
    "npm:aurelia-animator-css@1.0.0-beta.1.1.2": {
      "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.1.6",
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1",
      "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.1.2"
    },
    "npm:aurelia-binding@1.0.0-beta.1.2.2": {
      "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.1.6",
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1",
      "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.1.1"
    },
    "npm:aurelia-bootstrapper@1.0.0-beta.1.1.4": {
      "aurelia-event-aggregator": "npm:aurelia-event-aggregator@1.0.0-beta.1.1.1",
      "aurelia-framework": "npm:aurelia-framework@1.0.0-beta.1.1.4",
      "aurelia-history": "npm:aurelia-history@1.0.0-beta.1.1.1",
      "aurelia-history-browser": "npm:aurelia-history-browser@1.0.0-beta.1.1.4",
      "aurelia-loader-default": "npm:aurelia-loader-default@1.0.0-beta.1.1.3",
      "aurelia-logging-console": "npm:aurelia-logging-console@1.0.0-beta.1.1.4",
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1",
      "aurelia-pal-browser": "npm:aurelia-pal-browser@1.0.0-beta.1.1.4",
      "aurelia-polyfills": "npm:aurelia-polyfills@1.0.0-beta.1.0.1",
      "aurelia-router": "npm:aurelia-router@1.0.0-beta.1.1.3",
      "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.1.2",
      "aurelia-templating-binding": "npm:aurelia-templating-binding@1.0.0-beta.1.1.2",
      "aurelia-templating-resources": "npm:aurelia-templating-resources@1.0.0-beta.1.1.2",
      "aurelia-templating-router": "npm:aurelia-templating-router@1.0.0-beta.1.1.2"
    },
    "npm:aurelia-dependency-injection@1.0.0-beta.1.1.4": {
      "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.1.2",
      "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.1.6",
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1"
    },
    "npm:aurelia-event-aggregator@1.0.0-beta.1.1.1": {
      "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.1.2"
    },
    "npm:aurelia-framework@1.0.0-beta.1.1.4": {
      "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.2.2",
      "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.1.4",
      "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.1.1",
      "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.1.2",
      "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.1.6",
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1",
      "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.1.1",
      "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.1.1",
      "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.1.2"
    },
    "npm:aurelia-history-browser@1.0.0-beta.1.1.4": {
      "aurelia-history": "npm:aurelia-history@1.0.0-beta.1.1.1",
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1"
    },
    "npm:aurelia-http-client@1.0.0-beta.1.1.2": {
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1",
      "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.1.1"
    },
    "npm:aurelia-loader-default@1.0.0-beta.1.1.3": {
      "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.1.1",
      "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.1.6",
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1"
    },
    "npm:aurelia-loader@1.0.0-beta.1.1.1": {
      "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.1.6",
      "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.1.1"
    },
    "npm:aurelia-logging-console@1.0.0-beta.1.1.4": {
      "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.1.2",
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1"
    },
    "npm:aurelia-metadata@1.0.0-beta.1.1.6": {
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1"
    },
    "npm:aurelia-pal-browser@1.0.0-beta.1.1.4": {
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1"
    },
    "npm:aurelia-polyfills@1.0.0-beta.1.0.1": {
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1"
    },
    "npm:aurelia-route-recognizer@1.0.0-beta.1.1.3": {
      "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.1.1"
    },
    "npm:aurelia-router@1.0.0-beta.1.1.3": {
      "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.1.4",
      "aurelia-event-aggregator": "npm:aurelia-event-aggregator@1.0.0-beta.1.1.1",
      "aurelia-history": "npm:aurelia-history@1.0.0-beta.1.1.1",
      "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.1.2",
      "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.1.1",
      "aurelia-route-recognizer": "npm:aurelia-route-recognizer@1.0.0-beta.1.1.3"
    },
    "npm:aurelia-task-queue@1.0.0-beta.1.1.1": {
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1"
    },
    "npm:aurelia-templating-binding@1.0.0-beta.1.1.2": {
      "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.2.2",
      "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.1.2",
      "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.1.2"
    },
    "npm:aurelia-templating-resources@1.0.0-beta.1.1.2": {
      "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.2.2",
      "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.1.4",
      "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.1.1",
      "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.1.2",
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1",
      "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.1.1",
      "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.1.1",
      "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.1.2"
    },
    "npm:aurelia-templating-router@1.0.0-beta.1.1.2": {
      "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.1.4",
      "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.1.2",
      "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.1.6",
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1",
      "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.1.1",
      "aurelia-router": "npm:aurelia-router@1.0.0-beta.1.1.3",
      "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.1.2"
    },
    "npm:aurelia-templating@1.0.0-beta.1.1.2": {
      "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.2.2",
      "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.1.4",
      "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.1.1",
      "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.1.2",
      "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.1.6",
      "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1",
      "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.1.1",
      "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.1.1"
    },
    "npm:babel-runtime@5.8.35": {
      "process": "github:jspm/nodelibs-process@0.1.2"
    },
    "npm:core-js@2.1.3": {
      "fs": "github:jspm/nodelibs-fs@0.1.2",
      "path": "github:jspm/nodelibs-path@0.1.0",
      "process": "github:jspm/nodelibs-process@0.1.2",
      "systemjs-json": "github:systemjs/plugin-json@0.1.0"
    },
    "npm:font-awesome@4.5.0": {
      "css": "github:systemjs/plugin-css@0.1.20"
    },
    "npm:inherits@2.0.1": {
      "util": "github:jspm/nodelibs-util@0.1.0"
    },
    "npm:moment@2.12.0": {
      "process": "github:jspm/nodelibs-process@0.1.2"
    },
    "npm:numeral@1.5.3": {
      "fs": "github:jspm/nodelibs-fs@0.1.2"
    },
    "npm:path-browserify@0.0.0": {
      "process": "github:jspm/nodelibs-process@0.1.2"
    },
    "npm:process@0.11.2": {
      "assert": "github:jspm/nodelibs-assert@0.1.0"
    },
    "npm:util@0.10.3": {
      "inherits": "npm:inherits@2.0.1",
      "process": "github:jspm/nodelibs-process@0.1.2"
    }
  }
});```
jadrake75 commented 8 years ago

Myself and a few other devs at my company saw this when we went from 0.19 to 0.32. Similiar package.json/config.js to above (we are using 0.16 of JSPM)

Everything looks good in the bundle... it is just not loading/using the HTML

+1

EisenbergEffect commented 8 years ago

Is this still an issue?

ghost commented 8 years ago

I'm sorry for not letting anything know regarding this. Our development is currently focussed elsewhere and bundeling is not a priority so I can't for sure say if its still an issue or not.

You can close the issue for now. Should i run into the problem again ill just post here or create another issue with more details