aurelia / bundler

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

Bundle not modifying config or injecting bundled .js into my application #67

Closed zenvisuals closed 8 years ago

zenvisuals commented 8 years ago

Hi,

I ran gulp serve and then gulp bundle. It created a bundle called app-build.js and aurelia.js.

However when I reload the browser, it's still calling same amount of requests to get all the libraries and not the bundle.

Config.js seems untouched as well

Here is my bundle.js file

var gulp = require('gulp');
var bundler = require('aurelia-bundler');
var bundles = require('../bundles.json');

var config = {
  force: true,
  baseURL: '.',
  configPath: './config.js',
  bundles: bundles.bundles
};

gulp.task('bundle', ['unbundle', 'build'], function() {
  return bundler.bundle(config);
});

gulp.task('unbundle', function() {
  return bundler.unbundle(config);
});

and bundles.json file

{
  "bundles": {
    "dist/app-build": {
      "includes": [
        "[*]",
        "*.html!text",
        "*.css!text"
      ],
      "options": {
        "inject": true,
        "minify": true
      }
    },
    "dist/aurelia": {
      "includes": [
        "aurelia-framework",
        "aurelia-bootstrapper",
        "aurelia-fetch-client",
        "aurelia-router",
        "aurelia-animator-css",
        "aurelia-templating-binding",
        "aurelia-templating-resources",
        "aurelia-templating-router",
        "aurelia-loader-default",
        "aurelia-history-browser",
        "aurelia-logging-console",
        "bootstrap",
        "bootstrap/css/bootstrap.css!text"
      ],
      "options": {
        "inject": true,
        "minify": true
      }
    }
  }
}

What could have went wrong?

Thanks

ahmedshuhel commented 8 years ago

update SystemJS with jspm dl-loader. update bundler to v0.3.0 and finally change [*] to [*.js] in the bundle config above.

AStoker commented 8 years ago

I thought I had this same issue a second ago (hence the link), however it was a stupid mistake on my end (I was loading up the wrong index file... yah...). There's always those pesky little errors that require what we call in the office 'stupid checks'. Can you confirm that you are actually loading up the same index file that you're using in the bundled project? Also, have you tried unbundling, cleaning the dist folder, building, and then rebundling?

ahmedshuhel commented 8 years ago

Closing this one. @zenvisuals If you still have the problem feel free to raise a new issue. Thanks.