Skip to content
This repository has been archived by the owner on Aug 7, 2018. It is now read-only.

Src files in subdirectory - potential pathing issue? #15

Open
brianfeister opened this issue Mar 10, 2015 · 0 comments
Open

Src files in subdirectory - potential pathing issue? #15

brianfeister opened this issue Mar 10, 2015 · 0 comments
Labels

Comments

@brianfeister
Copy link

I've forked the seed project and made some high level architectural changes to it (moving everything from project root into client). I need to accommodate a Node backend in the same repo. Once I got all the other gulp config bits properly transitioned to my subdirectory architecture it was still not working properly. In gulpfile.js I expected to be able to do

gulp.task('build', ['compile-production'], function () {
  var routes = require('./client/src/app/routes.json');
  // get the source paths of our routes
  routes = routes.map(function (r) { return r.src; });

  var config = {
    baseURL: 'client',
    main: 'app/app',
    routes: routes,
    bundleThreshold: 0.6,
    config: './client/system.config.js',
    sourceMaps: true,
    minify: false,
    mangle: false,
    dest: 'client/dist/app',
    destJs: 'client/dist/app/app.js'
  }

  return routeBundler.build(config);
});

but the result is routeBundler dumping everything into client, when I expect it to go to client/dist. As a temporary fix, I've got system.config.js

System.config({
  "baseURL": "client",
  "paths": {
    "*": "dist/*.js",
    "systemjs-test/*": "client/src/*.js",
    "bower_components/*": "bower_components/*.js",
    "github:*": "jspm_packages/github/*.js",
    "npm:*": "jspm_packages/npm/*.js"
  },
  "buildCSS": true,
  "separateCSS": false
});

set to 'baseURL': 'client' and then override it in index.html via System.config({'baseURL': ''}) ... I'm sure this is not the intention of the builder, but it seems that it does not run correctly when sourcing from a non-root directory. Feel free to clone my forked project and tinker in the event that I missed a configuration detail.

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

No branches or pull requests

3 participants