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

pull features from angular2 seed #19

Closed
lathonez opened this issue Feb 24, 2016 · 9 comments
Closed

pull features from angular2 seed #19

lathonez opened this issue Feb 24, 2016 · 9 comments

Comments

@lathonez
Copy link
Owner

See what https://github.com/mgechev/angular2-seed have done since we forked and steal any cool stuff :)

@lathonez
Copy link
Owner Author

lathonez commented Mar 1, 2016

Had a quick look tonight, they have the following:

  • painless adding of node_modules (e.g. no karma.conf fuckery)
  • test watching (dunno if this is worth it with the boilerplate overhead, will see)
  • e2e testing with protractor

Ahead of this I've refactored gulpfile.js (now ts!) along the same lines as theirs.

@lathonez
Copy link
Owner Author

lathonez commented Mar 3, 2016

Taken gulp-inline-ng2-template in 0b6f152, so we don't need to copy html and need less proxying

This was referenced Mar 6, 2016
@lathonez
Copy link
Owner Author

lathonez commented Mar 7, 2016

When I include moment.js I still get a 404 from Karma using angular2 seed.

@lathonez
Copy link
Owner Author

lathonez commented Mar 7, 2016

As luck would have it, they've had the exact same issue raised there:

mgechev/angular-seed#468

So they're using system config instead of proxying in Karma. Seems a bit cleaner..

@lathonez
Copy link
Owner Author

lathonez commented Mar 7, 2016

They do in config.ts:

// ----------------
// SystemsJS Configuration.
const SYSTEM_CONFIG_DEV = {
  defaultJSExtensions: true,
  paths: {
    [BOOTSTRAP_MODULE]: `${APP_BASE}${BOOTSTRAP_MODULE}`,
    'angular2/*': `${APP_BASE}angular2/*`,
    'rxjs/*': `${APP_BASE}rxjs/*`,
    '*': `${APP_BASE}node_modules/*`
  },
  packages: {
    angular2: { defaultExtension: false },
    rxjs: { defaultExtension: false }
  }
};

export const SYSTEM_CONFIG = SYSTEM_CONFIG_DEV;

And then this in index.html:

  <% if (ENV === 'dev') { %>
  <script>System.config(<%= JSON.stringify(SYSTEM_CONFIG) %>)</script>
  <% } %>

which is built as part of build.dev.index:

export = function buildIndexDev(gulp, plugins) {
  return function () {
    return gulp.src(join(APP_SRC, 'index.html'))
      .pipe(inject('shims'))
      .pipe(inject('libs'))
      .pipe(inject())
      .pipe(plugins.template(templateLocals()))
      .pipe(gulp.dest(APP_DEST));
  };

@lathonez
Copy link
Owner Author

lathonez commented Mar 7, 2016

Lot of flapping, but it might help us get away from stuff like this

@lathonez
Copy link
Owner Author

lathonez commented Mar 7, 2016

Seems like a bit of a rabbit hole considering it doesn't give you external deps for free, dropping

@lathonez
Copy link
Owner Author

lathonez commented Mar 7, 2016

test debug watching working & written up

@lathonez
Copy link
Owner Author

lathonez commented Mar 9, 2016

Closed in favour of #38

@lathonez lathonez closed this as completed Mar 9, 2016
@lathonez lathonez mentioned this issue Mar 9, 2016
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