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

CP-2039 fix(init): issue #162 #167

Merged
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
8 changes: 5 additions & 3 deletions src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ module.exports = function(files, basePath, jspm, client, emitter) {
return packagesPath + fileName + '.js';
}
}

Array.prototype.unshift.apply(files,
configPaths.map(function(configPath) {
return createPattern(configPath)
})
);

// Needed for JSPM 0.17 beta
if(jspm.browser) {
files.unshift(createPattern(browserPath));
Expand Down Expand Up @@ -139,7 +139,9 @@ module.exports = function(files, basePath, jspm, client, emitter) {

// Allow Karma to serve all files within jspm_packages.
// This allows jspm/SystemJS to load them
var jspmPattern = createServedPattern(packagesPath + '**/*', {nocache: jspm.cachePackages !== true});
var jspmPattern = createServedPattern(
packagesPath + '!(system-polyfills.src.js|system.src.js)/**', {nocache: jspm.cachePackages !== true}
);
jspmPattern.watched = false;
files.push(jspmPattern);
};
2 changes: 1 addition & 1 deletion test/testInit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('jspm plugin init', function(){
});

it('should use the configured jspm_packages path and include it at the end of the files array', function(){
expect(normalPath(files[files.length - 1].pattern)).toEqual(normalPath(path.resolve(cwd, './custom_packages/**/*')));
expect(normalPath(files[files.length - 1].pattern)).toEqual(normalPath(path.resolve(cwd, './custom_packages/!(system-polyfills.src.js|system.src.js)/**')));
expect(files[files.length - 1].included).toEqual(false);
expect(files[files.length - 1].served).toEqual(true);
expect(files[files.length - 1].watched).toEqual(false);
Expand Down