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

Create tmp files with .browserify.js extension #219

Merged
merged 5 commits into from Nov 30, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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