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
Avi Sharvit
committed
Mar 18, 2019
1 parent
30cb538
commit 43ea2da
Showing
4 changed files
with
64 additions
and
60 deletions.
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 |
---|---|---|
@@ -1,66 +1,63 @@ | ||
let path = require('path'); | ||
|
||
// Use storybook's default configuration with our customizations | ||
module.exports = (baseConfig, env, defaultConfig) => { | ||
|
||
// overwrite storybook's default import rules | ||
defaultConfig.module.rules = [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader', | ||
options: { | ||
presets: [ | ||
path.join(__dirname, '..', 'node_modules/babel-preset-react'), | ||
path.join(__dirname, '..', 'node_modules/babel-preset-env') | ||
], | ||
plugins: [ | ||
path.join(__dirname, '..', 'node_modules/babel-plugin-transform-class-properties'), | ||
path.join(__dirname, '..', 'node_modules/babel-plugin-transform-object-rest-spread'), | ||
path.join(__dirname, '..', 'node_modules/babel-plugin-transform-object-assign'), | ||
path.join(__dirname, '..', 'node_modules/babel-plugin-syntax-dynamic-import') | ||
] | ||
} | ||
}, | ||
{ | ||
test: /(\.png|\.gif)$/, | ||
loader: 'url-loader?limit=32767' | ||
}, | ||
{ | ||
test: /\.css$/, | ||
loaders: ['style-loader', 'css-loader'] | ||
}, | ||
{ | ||
test: /\.scss$/, | ||
loaders: ['style-loader', 'css-loader', { | ||
loader: 'sass-loader', | ||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader', | ||
options: { | ||
includePaths: [ | ||
// teach webpack to resolve patternfly dependencies | ||
path.resolve(__dirname, '..', 'node_modules', 'patternfly', 'dist', 'sass'), | ||
path.resolve(__dirname, '..', 'node_modules', 'bootstrap-sass', 'assets', 'stylesheets'), | ||
path.resolve(__dirname, '..', 'node_modules', 'font-awesome-sass', 'assets', 'stylesheets') | ||
presets: [ | ||
path.join(__dirname, '..', 'node_modules/babel-preset-react'), | ||
path.join(__dirname, '..', 'node_modules/babel-preset-env') | ||
], | ||
plugins: [ | ||
path.join(__dirname, '..', 'node_modules/babel-plugin-transform-class-properties'), | ||
path.join(__dirname, '..', 'node_modules/babel-plugin-transform-object-rest-spread'), | ||
path.join(__dirname, '..', 'node_modules/babel-plugin-transform-object-assign'), | ||
path.join(__dirname, '..', 'node_modules/babel-plugin-syntax-dynamic-import') | ||
] | ||
} | ||
}] | ||
}, | ||
{ | ||
test: /\.md$/, | ||
loaders: ['raw-loader'] | ||
}, | ||
{ | ||
test: /(\.ttf|\.woff|\.woff2|\.eot|\.svg|\.jpg)$/, | ||
loaders: ['url-loader'] | ||
}, | ||
] | ||
}, | ||
{ | ||
test: /(\.png|\.gif)$/, | ||
loader: 'url-loader?limit=32767' | ||
}, | ||
{ | ||
test: /\.css$/, | ||
loaders: ['style-loader', 'css-loader'], | ||
}, | ||
{ | ||
test: /\.scss$/, | ||
loaders: ['style-loader', 'css-loader', { | ||
loader: 'sass-loader', | ||
options: { | ||
includePaths: [ | ||
// teach webpack to resolve patternfly dependencies | ||
path.resolve(__dirname, '..', 'node_modules', 'patternfly', 'dist', 'sass'), | ||
path.resolve(__dirname, '..', 'node_modules', 'bootstrap-sass', 'assets', 'stylesheets'), | ||
path.resolve(__dirname, '..', 'node_modules', 'font-awesome-sass', 'assets', 'stylesheets') | ||
] | ||
} | ||
}] | ||
}, | ||
{ | ||
test: /\.md$/, | ||
loaders: ['raw-loader'] | ||
}, | ||
{ | ||
test: /(\.ttf|\.woff|\.woff2|\.eot|\.svg|\.jpg)$/, | ||
loaders: ['url-loader'] | ||
}, | ||
], | ||
}, | ||
|
||
defaultConfig.resolve = { | ||
resolve: { | ||
modules: [ | ||
path.join(__dirname, '..', 'webpack'), | ||
path.join(__dirname, '..', 'node_modules'), | ||
'node_modules/', | ||
], | ||
}; | ||
|
||
return defaultConfig; | ||
}, | ||
}; |
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
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
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,6 @@ | ||
$img-path: '~patternfly/dist/img/'; | ||
$font-path: '~patternfly/dist/fonts/'; | ||
$icon-font-path: '~patternfly/dist/fonts/'; | ||
|
||
@import '~patternfly/dist/sass/patternfly'; | ||
@import '~patternfly-react/dist/sass/patternfly-react'; |