Skip to content

Commit

Permalink
fixed react-styleguidist
Browse files Browse the repository at this point in the history
  • Loading branch information
a.stambultsian committed Jan 29, 2020
1 parent cfe1eca commit 1c71c4b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"autoprefixer": "^7.2.3",
"babel-loader": "^8.0.4",
"classnames": "^2.2.6",
"clean-webpack-plugin": "^3.0.0",
"concurrently": "^4.1.2",
"css-loader": "^3.2.0",
"eslint": "~6.8.0",
Expand Down
11 changes: 11 additions & 0 deletions styleguide/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const webpackConfig = require('../webpack.config');
const merge = require('webpack-merge');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const postcssConfig = require('../postcss.config');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');

module.exports = {
title: 'VKUI styleguide',
Expand Down Expand Up @@ -162,6 +163,16 @@ module.exports = {
return require('react-docgen').parse(source, resolver, handlers, { filename: filePath })
}
},
dangerouslyUpdateWebpackConfig(webpackConfig) { // запрещаем вычищать .git
webpackConfig.plugins = webpackConfig.plugins.reduce((acc, item) => {
if (item instanceof CleanWebpackPlugin) {
item.cleanOnceBeforeBuildPatterns = ['**/*', '!.git'];
}
acc.push(item);
return acc;
}, [])
return webpackConfig;
},
webpackConfig: merge(webpackConfig, {
module: {
rules: [{
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const config = {
'react-dom': 'react-dom'
},
/@vkontakte\/icons/i
]
],
};

const devConfig = {
Expand Down

0 comments on commit 1c71c4b

Please sign in to comment.