Browse Source

Merge pull request #143 from meriadec/master

Prevent throw of staticPath helper in storybook context
master
Meriadec Pillet 7 years ago
committed by GitHub
parent
commit
638aca3051
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/helpers/staticPath.js

5
src/helpers/staticPath.js

@ -1,5 +1,6 @@
const isRunningInAsar = process.mainModule.filename.indexOf('app.asar') !== -1
const isStorybook = !process.mainModule
const isRunningInAsar = !isStorybook && process.mainModule.filename.indexOf('app.asar') !== -1
export default (__DEV__
export default (__DEV__ && !isStorybook
? __static
: isRunningInAsar ? __dirname.replace(/app\.asar$/, 'static') : `${__dirname}/../static`)

Loading…
Cancel
Save