Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/pack-question.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ It generates 2 javascript files:
> Note: This doesn't generate the final question for you. To do that you'll need to create the final html page, include the 2 js files above, and use a controller that can interact with the controller-map.js file. See [pie-docs](http://pielabs.github.io/pie-docs) for more infomation.

### Options
`--pieBranch` - what branch of the pie dependencies (pie-player, pie-control-panel, etc) to use: default: `develop`.
`--clean` - clean build assets before packing. default: `false`
`--support` - a js file to load to add support for a build type. See below.
`--dir` - the relative path to a directory to use as the root. This should contain `config.json` and `index.html` (default: the current working directory)
Expand Down
38 changes: 24 additions & 14 deletions src/question/packer.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class Packer {

logger.silly('[pack] opts: ', opts);

let npmDependencies = _.extend({}, DEFAULT_DEPENDENCIES, this._question.npmDependencies);
let npmDependencies = _.extend({}, DEFAULT_DEPENDENCIES(opts.pieBranch), this._question.npmDependencies);

logger.debug('npm dependencies: ', JSON.stringify(npmDependencies));

Expand Down Expand Up @@ -93,18 +93,27 @@ export default class Packer {
}
}

export const DEFAULT_DEPENDENCIES = {
'babel-core': '^6.17.0',
'babel-loader': '^6.2.5',
'style-loader': '^0.13.1',
'css-loader': '^0.25.0',
'babel-preset-es2015': '^6.16.0',
'css-loader': '^0.25.0',
'pie-player': 'PieLabs/pie-player',
'pie-controller': 'PieLabs/pie-controller',
'pie-control-panel': 'PieLabs/pie-control-panel',
'style-loader': '^0.13.1',
'webpack': '2.1.0-beta.21'
export let DEFAULT_DEPENDENCIES = (branch) => {

branch = branch || 'master';

let branchSpecific = {
'pie-player': `PieLabs/pie-player#${branch}`,
'pie-controller': `PieLabs/pie-controller#${branch}`,
'pie-control-panel': `PieLabs/pie-control-panel#${branch}`
}

return _.extend({
'babel-core': '^6.17.0',
'babel-loader': '^6.2.5',
'style-loader': '^0.13.1',
'css-loader': '^0.25.0',
'babel-preset-es2015': '^6.16.0',
'css-loader': '^0.25.0',
'style-loader': '^0.13.1',
'webpack': '2.1.0-beta.21'

}, branchSpecific);
};

export const DEFAULTS = {
Expand All @@ -117,5 +126,6 @@ export const DEFAULTS = {
keepBuildAssets: true,
pieJs: 'pie.js',
controllersJs: 'controllers.js',
fullInstall: false
fullInstall: false,
pieBranch: 'develop'
}