Skip to content

Commit

Permalink
Use .browserify.js extension, require karma@3 (#219)
Browse files Browse the repository at this point in the history
* create tmp file with `.browserify.js` extension
* require karma>=3
* require node>=6
  • Loading branch information
etpinard authored and bendrucker committed Nov 30, 2018
1 parent f43caad commit 496d05c
Show file tree
Hide file tree
Showing 7 changed files with 1,362 additions and 1,105 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -2,7 +2,6 @@ language: node_js
node_js:
- '8'
- '6'
- '4'
sudo: false
script:
- npm run all
Expand Down
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -23,7 +23,7 @@ module.exports = {


// override the default preprocess factory to add our
// preprocessor for *.browserify files
// preprocessor for *.browserify.js files

try {
module.exports.preprocess = [ 'factory', require('./lib/preprocessor').createPreprocessor ];
Expand Down
2 changes: 1 addition & 1 deletion lib/bundle-file.js
Expand Up @@ -17,7 +17,7 @@ function getTempFileName(suffix) {
*/
function BundleFile() {

var location = getTempFileName('.browserify');
var location = getTempFileName('.browserify.js');

function write(content) {
fs.writeFileSync(location, content);
Expand Down
6 changes: 3 additions & 3 deletions lib/preprocessor.js
Expand Up @@ -26,15 +26,15 @@ function getPreprocessorFactory() {


/**
* Monkey patch preprocessors to preprocess *.browserify
* Monkey patch preprocessors to preprocess *.browserify.js
*/

var originalFactory = getPreprocessorFactory();

var createPreprocessor = function(config, basePath, injector) {

// add our preprocessor for .browserify files
config[path.resolve(os.tmpdir(), '*.browserify')] = ['browserify-bundle'];
// add our preprocessor for .browserify.js files
config[path.resolve(os.tmpdir(), '*.browserify.js')] = ['browserify-bundle'];

return originalFactory(config, basePath, injector);
};
Expand Down

0 comments on commit 496d05c

Please sign in to comment.