aurelia / bundler

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

Bundling SystemJS 0.20 app does not find packages #164

Closed ZoolWay closed 6 years ago

ZoolWay commented 7 years ago

I'm submitting a bug report

Current behavior: The app runs fine in unbundled mode.

jspm.config.js (in wwwroot folder were also index.html is):

SystemJS.config({
  baseURL: "/dist",
  browserConfig: {
    "paths": {
      "kendo-ui/": "styles/kendo/",
      "github:": "../jspm_packages/github/",
      "npm:": "../jspm_packages/npm/",
      "jspm_packages/npm/jquery-ui@1.12.1/": "jspm_packages/npm/jquery-ui@1.12.1/ui/"
    }
  },
  transpiler: false,
  ...

bundes.js:

module.exports = {
    "bundles": {
        "dist/app": {
            "includes": [
              "[**/*.js]",
              "**/*.html!text",
              "**/*.css!text",
              "**/*.json!json"
            ],
            "options": {
                "inject": true,
                "minify": false,
                "depCache": true,
                "rev": false
            }
        },
        "dist/vendor": {
            "includes": [
                "bootstrap",
                "bootstrap/css/bootstrap.css!text",
                "jquery",
                "jquery-ui",
                "gridstack",
                "gridstack/dist/gridstack.min.css!text",
                "gridstack/dist/gridstack-extra.min.css!text",
                "mmenu",
                "moment",
                "font-awesome",
                "toastr",
                "howler",
                "ms-signalr-client"
            ],
            "options": {
                "inject": true,
                "minify": false,
                "depCache": false,
                "rev": false
            }
        },
        "dist/aurelia": {
            "includes": [
              "aurelia-framework",
              "aurelia-bootstrapper",
              "aurelia-http-client",
              "aurelia-router",
              "aurelia-animator-css",
              "aurelia-templating-binding",
              "aurelia-polyfills",
              "aurelia-templating-resources",
              "aurelia-templating-router",
              "aurelia-loader-default",
              "aurelia-history-browser",
              "aurelia-logging",
              "aurelia-logging-console",
              "aurelia-i18n",
              "aurelia-event-aggregator",
              "aurelia-pal",
              "aurelia-pal-browser",
              "aurelia-dialog",
              "i18next-xhr-backend",
              "aurelia-resize"
            ],
            "options": {
                "inject": true,
                "minify": false,
                "depCache": false,
                "rev": false
            }
        }
    }
};

I get this error message when aurelia bundler is run:

(SystemJS) ENOENT: no such file or directory, open 'C:\path-to-project\wwwroot\github:twbs\bootstrap@3.3.7.json'

Note that the path is missing jspm_packages and also github:twbs should be github\twbs in the file system.

ZoolWay commented 7 years ago

If you are interested I have build a small project for the issue #230 in aurelia-i18n and added bundling to it. The problem occurs there too:

https://github.com/telecomsoftware/sample-aurelia-i18n-i230

[14:49:00] (SystemJS) ENOENT: no such file or directory, open 'C:\Working\aurelia-i18n-issue-230\text.js'
        Error: ENOENT: no such file or directory, open 'C:\Working\aurelia-i18n-issue-230\text.js'
        Error loading C:/Working/aurelia-i18n-issue-230/text.js

This minimal setup without a src folder is not supposed to work in the end with a bundle but it shows that aurelia-bundler struggles with a SystemJS 0.20 setup. I guess thats because SystemJS 0.20 also requires a newer SystemJS builder.

Note: Global gulp CLI must be installed because it uses gulp 4.

ahmedshuhel commented 7 years ago

Thanks. It will help debugging the issue.

ZoolWay commented 7 years ago

@ahmedshuhel This is not fixed in 0.6.4, is it?

ahmedshuhel commented 7 years ago

@ZoolWay no. Working on it.

hypetsch commented 7 years ago

Hi, I'm facing the same issue - any updates yet?

KoltesDigital commented 6 years ago

I had this issue. I noted that text was a devDependency. Installing it as a dependency (jspm i text) solved the problem.

Alexander-Taran commented 6 years ago

can be closed? with workaround provided