Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building all public files to www folder #933

Open
Serhioromano opened this issue Jun 9, 2019 · 0 comments
Open

Building all public files to www folder #933

Serhioromano opened this issue Jun 9, 2019 · 0 comments

Comments

@Serhioromano
Copy link

I am trying to setup an app, but I am not really happy with the project structure. I use aurelia-cli to build app. My which is to have all files like ts, less, in src folder, and after build move it to www so that this folder becomes app web root and contains only website files. My root of the project might have so many other configuration files, so I do not want to have that mess in the project root.

I have been able to configure everything as I want and only one thing is not working. First let me say what I did in aurelia.json

"platform": {
    "port": 9000,
    "index": "index.html",
    "baseDir": "www",
    "output": "www/scripts"
  },
  "build": {
    "targets": [
      {
        "port": 9000,
        "index": "index.html",
        "baseDir": "www",
        "output": "www/scripts"
      }
    ],

this is places where ш added www. Output for build process mode bundles to www folder. baseDir so that web server on au run --watch starts in the www folder as root.

But I have problem that vendor-bundle.js at the end generate

function _aureliaConfigureModuleLoader(){window.define=SystemJS.amdDefine; window.require=window.requirejs=SystemJS.amdRequire; SystemJS.config({
  "map": {
    "text": "text",
    "app-bundle": "www/scripts/app-bundle.js"
  },
  "bundles": {
    "app-bundle": [
      "app",
      "app.html!text",
      "ext/home/home",
      "ext/home/index",
      "ext/home/tmpl/home.html!text",
      "ext/home/tmpl/index.html!text",
      "main",
      "unknow",
      "unknow.html!text",
    ]
  }
});

You can see that it adds www/ to app-bundle.js directory. So that when it is loaded, it cannot load app-bundle. If I fix it by hand, everything works until the new update of vendor-bundle file.

And there is not way to fix it from configuration as I can see. If I delete www in aurelia.json then is generates scripts in the other folder, not inside www, if ш keep it, it adds www to that path.

I think that baseDir has to be deleted from the path to file. So fix have to be applied in aurelia-cli. I tried to find it and make PR, but I could not find, it is too complicated for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant