-
Notifications
You must be signed in to change notification settings - Fork 833
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint-env node */ | ||
const {join} = require('path'); | ||
const isProd = process.env.NODE_ENV === 'production'; | ||
|
||
// This custom webpack config allows storybook to use the source files from 'react-vis'. | ||
// Changes can be made and instantly be reflected in storybook to allow quick development | ||
module.exports = { | ||
webpackFinal: config => { | ||
if (isProd) { return config;} | ||
|
||
const reactVisPath = join(__dirname, '../../react-vis/src') | ||
|
||
// Add an alias to 'react-vis' so that it looks in its src directory. | ||
config.resolve.alias['react-vis'] =reactVisPath | ||
config.resolve.modules.push(reactVisPath) | ||
|
||
const jsRule = config.module.rules.find(rule => rule.test.test('test.js')); | ||
// Add the react-vis/src folder to the list of files to compile | ||
jsRule.include.push(reactVisPath) | ||
|
||
const babelLoader = jsRule.use.find(x => x.loader === 'babel-loader'); | ||
if (babelLoader) { | ||
babelLoader.options.rootMode = 'upward' | ||
} | ||
|
||
return config; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters