Skip to content

Commit

Permalink
🐛 Check src directory for post-install (#219)
Browse files Browse the repository at this point in the history
This package exports a test helper which means the test directory is also present in production. The
src files should never be included, so should be a much safer check.
  • Loading branch information
Wil Wilsman authored Mar 1, 2021
1 parent 861cd4e commit e7ca54b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/post-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ if (process.env.PERCY_POSTINSTALL_BROWSER || require.main !== module) {
const fs = require('fs');
const path = require('path');

// the test directory indicates postinstall during development
const isDev = fs.existsSync(path.join(__dirname, 'test'));
// the src directory indicates postinstall during development
const isDev = fs.existsSync(path.join(__dirname, 'src'));

// register babel transforms for development install
if (isDev) require('../../scripts/babel-register');
Expand Down

0 comments on commit e7ca54b

Please sign in to comment.