Browse Source

Prevent throw of staticPath helper in storybook context

master
meriadec 7 years ago
parent
commit
fd50660b15
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  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