Skip to content

Commit

Permalink
feat: loader plugin load in preset
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Apr 16, 2020
1 parent d37520e commit 08f59a0
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
7 changes: 1 addition & 6 deletions examples/storybook-6-no-docs/.storybook/main.js
@@ -1,5 +1,4 @@
const path = require('path');
const storyStorePlugin = require('@component-controls/loader/plugin');

module.exports = {
presets:[
Expand Down Expand Up @@ -109,10 +108,6 @@ module.exports = {
resolve: {
...config.resolve,
extensions: [...(config.resolve.extensions || []), '.ts', '.tsx'],
},
plugins: [
new storyStorePlugin(),
...config.plugins,
]
},
}},
};
1 change: 0 additions & 1 deletion examples/storybook-6-no-docs/package.json
Expand Up @@ -9,7 +9,6 @@
"build-storybook": "build-storybook -c .storybook -o ./docs"
},
"dependencies": {
"@component-controls/loader": "^0.6.0",
"@component-controls/react-docgen-info": "^0.6.0",
"@component-controls/react-docgen-typescript-info": "^0.6.0",
"@component-controls/storybook": "^0.6.0",
Expand Down
5 changes: 0 additions & 5 deletions examples/storybook-6/.storybook/main.js
@@ -1,5 +1,4 @@
const path = require('path');
const storyStorePlugin = require('@component-controls/loader/plugin');

module.exports = {
presets:[
Expand Down Expand Up @@ -72,9 +71,5 @@ module.exports = {
...config.resolve,
extensions: [...(config.resolve.extensions || []), '.ts', '.tsx'],
},
plugins: [
new storyStorePlugin(),
...config.plugins,
]
}},
};
1 change: 0 additions & 1 deletion examples/storybook-6/package.json
Expand Up @@ -9,7 +9,6 @@
"build-storybook": "build-storybook -c .storybook -o ../../docs"
},
"dependencies": {
"@component-controls/loader": "^0.6.0",
"@component-controls/react-docgen-info": "^0.6.0",
"@component-controls/react-docgen-typescript-info": "^0.6.0",
"@component-controls/storybook": "^0.6.0",
Expand Down
3 changes: 3 additions & 0 deletions integrations/storybook/src/preset.ts
@@ -1,4 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
const storyStorePlugin = require('@component-controls/loader/plugin');

module.exports = {
config: (entry: any[] = [], options: any = {}) => {
const result = [...entry];
Expand All @@ -13,6 +15,7 @@ module.exports = {
webpack: (webpackConfig: any = {}, options: any = {}) => {
const result = {
...webpackConfig,
plugins: [new storyStorePlugin(), ...webpackConfig.plugins],
};
return result;
},
Expand Down

0 comments on commit 08f59a0

Please sign in to comment.