-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2788 from storybooks/move-more-things-to-core
Move more things to core
- Loading branch information
Showing
31 changed files
with
123 additions
and
631 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,73 +1,5 @@ | ||
// import webpack from 'webpack'; | ||
import autoprefixer from 'autoprefixer'; | ||
import { createDefaultWebpackConfig } from '@storybook/core/server'; | ||
import { includePaths } from '../utils'; | ||
|
||
// Add a default custom config which is similar to what React Create App does. | ||
module.exports = storybookBaseConfig => { | ||
const newConfig = { ...storybookBaseConfig }; | ||
|
||
newConfig.module.rules = [ | ||
...storybookBaseConfig.module.rules, | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
require.resolve('style-loader'), | ||
{ | ||
loader: require.resolve('css-loader'), | ||
options: { | ||
importLoaders: 1, | ||
}, | ||
}, | ||
{ | ||
loader: require.resolve('postcss-loader'), | ||
options: { | ||
ident: 'postcss', // https://webpack.js.org/guides/migrating/#complex-options | ||
plugins: () => [ | ||
require('postcss-flexbugs-fixes'), // eslint-disable-line | ||
autoprefixer({ | ||
browsers: [ | ||
'>1%', | ||
'last 4 versions', | ||
'Firefox ESR', | ||
'not ie < 9', // React doesn't support IE8 anyway | ||
], | ||
flexbox: 'no-2009', | ||
}), | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
test: /\.json$/, | ||
include: includePaths, | ||
loader: require.resolve('json-loader'), | ||
}, | ||
{ | ||
test: /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/, | ||
include: includePaths, | ||
loader: require.resolve('file-loader'), | ||
query: { | ||
name: 'static/media/[name].[hash:8].[ext]', | ||
}, | ||
}, | ||
{ | ||
test: /\.(mp4|webm|wav|mp3|m4a|aac|oga)(\?.*)?$/, | ||
include: includePaths, | ||
loader: require.resolve('url-loader'), | ||
query: { | ||
limit: 10000, | ||
name: 'static/media/[name].[hash:8].[ext]', | ||
}, | ||
}, | ||
]; | ||
|
||
newConfig.resolve.alias = { | ||
...storybookBaseConfig.resolve.alias, | ||
// This is to support NPM2 | ||
'babel-runtime/regenerator': require.resolve('babel-runtime/regenerator'), | ||
}; | ||
|
||
// Return the altered config | ||
return newConfig; | ||
}; | ||
module.exports = storybookBaseConfig => | ||
createDefaultWebpackConfig(storybookBaseConfig, includePaths); |
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 |
---|---|---|
@@ -1,17 +1 @@ | ||
// import deprecate from 'util-deprecate'; | ||
|
||
// NOTE export these to keep backwards compatibility | ||
// import { action as deprecatedAction } from '@storybook/addon-actions'; | ||
// import { linkTo as deprecatedLinkTo } from '@storybook/addon-links'; | ||
|
||
export { storiesOf, setAddon, addDecorator, configure, getStorybook } from './preview'; | ||
|
||
// export const action = deprecate( | ||
// deprecatedAction, | ||
// '@storybook/react action is deprecated. See: https://github.com/storybooks/storybook/tree/master/addons/actions' | ||
// ); | ||
|
||
// export const linkTo = deprecate( | ||
// deprecatedLinkTo, | ||
// '@storybook/react linkTo is deprecated. See: https://github.com/storybooks/storybook/tree/master/addons/links' | ||
// ); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,73 +1,5 @@ | ||
// import webpack from 'webpack'; | ||
import autoprefixer from 'autoprefixer'; | ||
import { createDefaultWebpackConfig } from '@storybook/core/server'; | ||
import { includePaths } from '../utils'; | ||
|
||
// Add a default custom config which is similar to what React Create App does. | ||
module.exports = storybookBaseConfig => { | ||
const newConfig = { ...storybookBaseConfig }; | ||
|
||
newConfig.module.rules = [ | ||
...storybookBaseConfig.module.rules, | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
require.resolve('style-loader'), | ||
{ | ||
loader: require.resolve('css-loader'), | ||
options: { | ||
importLoaders: 1, | ||
}, | ||
}, | ||
{ | ||
loader: require.resolve('postcss-loader'), | ||
options: { | ||
ident: 'postcss', // https://webpack.js.org/guides/migrating/#complex-options | ||
plugins: () => [ | ||
require('postcss-flexbugs-fixes'), // eslint-disable-line | ||
autoprefixer({ | ||
browsers: [ | ||
'>1%', | ||
'last 4 versions', | ||
'Firefox ESR', | ||
'not ie < 9', // React doesn't support IE8 anyway | ||
], | ||
flexbox: 'no-2009', | ||
}), | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
test: /\.json$/, | ||
include: includePaths, | ||
loader: require.resolve('json-loader'), | ||
}, | ||
{ | ||
test: /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/, | ||
include: includePaths, | ||
loader: require.resolve('file-loader'), | ||
query: { | ||
name: 'static/media/[name].[hash:8].[ext]', | ||
}, | ||
}, | ||
{ | ||
test: /\.(mp4|webm|wav|mp3|m4a|aac|oga)(\?.*)?$/, | ||
include: includePaths, | ||
loader: require.resolve('url-loader'), | ||
query: { | ||
limit: 10000, | ||
name: 'static/media/[name].[hash:8].[ext]', | ||
}, | ||
}, | ||
]; | ||
|
||
newConfig.resolve.alias = { | ||
...storybookBaseConfig.resolve.alias, | ||
// This is to support NPM2 | ||
'babel-runtime/regenerator': require.resolve('babel-runtime/regenerator'), | ||
}; | ||
|
||
// Return the altered config | ||
return newConfig; | ||
}; | ||
module.exports = storybookBaseConfig => | ||
createDefaultWebpackConfig(storybookBaseConfig, includePaths); |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.