Skip to content

Commit

Permalink
Fixed issue #13, prep for v0.1.11 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Christpher Mason committed Sep 27, 2017
1 parent 4c86f01 commit cd52d6c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v0.1.11

* Fixed issue #13
* Updated all dependencies to current latest
* Added ```packagePath``` and ```configFile``` options

## v0.1.10

* Added ```jspm.setPackagePath(_system.baseURL);```
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ var Bundler = require('jspm-bundler');

var bundler = new Bundler({

baseURL: '.', // Must be the same baseURL as SystemJS.
baseURL: '', // Must be the same baseURL as SystemJS.
configFile: '', // System config (defaults to config.js)
packagePath: '', // Path to package.json (defaults to root)

// Paths are relative to your baseURL.
dest: 'bundles', // Path to folder where bundles are saved.
Expand Down
18 changes: 11 additions & 7 deletions bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ function JSPMBundler(opts) {

var _system = {
config: {},
baseURL: ''
baseURL: opts.baseURL || '',
packagePath: opts.packagePath || '',
configFile: opts.configFile || 'config.js'
};

if (path.isAbsolute(opts.baseURL)) {
_system.baseURL = opts.baseURL;
} else {
_system.baseURL = path.join(root, opts.baseURL, '/') || root;
if (!path.isAbsolute(_system.baseURL)) {
_system.baseURL = path.join(root, _system.baseURL, '/') || root;
}

if (!path.isAbsolute(_system.packagePath)) {
_system.packagePath = path.join(root, _system.packagePath, '/') || root;
}

_system.config = _getSystemJSConfig();
Expand Down Expand Up @@ -520,8 +524,8 @@ function JSPMBundler(opts) {
*/
function _getSystemJSConfig() {
var jspm = require('jspm');
jspm.setPackagePath(_system.baseURL);
var file = path.join(_system.baseURL, 'config.js');
jspm.setPackagePath(_system.packagePath);
var file = path.join(_system.baseURL, _system.configFile);
require(file);
return System.config;
}
Expand Down
2 changes: 1 addition & 1 deletion npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jspm-bundler",
"version": "0.1.10",
"version": "0.1.11",
"description": "more configurable bundler for jspm",
"main": "bundler.js",
"scripts": {
Expand Down

0 comments on commit cd52d6c

Please sign in to comment.