aboutsummaryrefslogtreecommitdiffstats
path: root/.storybook/webpack.config.js
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2018-05-21 20:19:48 +0000
committerGerrit Code Review <gerrit@onap.org>2018-05-21 20:19:48 +0000
commit05b37297177e8a342668c15e5d6f738b51f7aedd (patch)
treee236c96df52a13f935292db8aa73e84d0c41ad8a /.storybook/webpack.config.js
parent884dfb789593d2a3cc319047ab1f0215778aec9f (diff)
parent1994c98063c27a41797dec01f2ca9fcbe33ceab0 (diff)
Merge "init commit onap ui"2.0.0-ONAPbeijing2.0.0-ONAP
Diffstat (limited to '.storybook/webpack.config.js')
-rw-r--r--.storybook/webpack.config.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js
new file mode 100644
index 0000000..a923d80
--- /dev/null
+++ b/.storybook/webpack.config.js
@@ -0,0 +1,39 @@
+
+const path = require('path');
+const webpack = require('webpack');
+const svgFolder = './assets/icons/';
+const fs = require('fs');
+
+let iconNames = [];
+
+fs.readdirSync(svgFolder).forEach(file => {
+ let fileName = file.split('.');
+ if (fileName[0] && fileName[1] === 'svg') {
+ iconNames.push(fileName[0]);
+ }
+});
+
+module.exports = {
+ module: {
+ rules: [
+ {
+ test: /.scss$/,
+ use: ['style-loader', 'css-loader', 'sass-loader'],
+ include: path.resolve(__dirname, '../')
+ },
+ {
+ test: /.html$/,
+ loader: 'html-loader',
+ options: {
+ minimize: false
+ }
+ }
+ ]
+ },
+ plugins: [
+ new webpack.DefinePlugin({
+ 'ICON_PATH': '"./"',
+ 'ICON_NAMES':JSON.stringify(iconNames)
+ })
+ ]
+};