summaryrefslogtreecommitdiffstats
path: root/.storybook/webpack.config.js
diff options
context:
space:
mode:
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)
+ })
+ ]
+};