-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove default webpack config for all config types.
Now we only use the Create React App based config if there's no custom webpack config. This will fix issues like #347.
- Loading branch information
Showing
20 changed files
with
108 additions
and
137 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
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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
'use strict'; | ||
|
||
var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray'); | ||
|
||
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); | ||
|
||
var _autoprefixer = require('autoprefixer'); | ||
|
||
var _autoprefixer2 = _interopRequireDefault(_autoprefixer); | ||
|
||
var _paths = require('../paths'); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
// Add a default custom config which is similar to what React Create App does. | ||
module.exports = function (storybookBaseConfig, configType) { | ||
var newConfig = storybookBaseConfig; | ||
newConfig.module.loaders = [].concat((0, _toConsumableArray3.default)(newConfig.module.loaders), [{ | ||
test: /\.css?$/, | ||
include: _paths.includePaths, | ||
loader: 'style!css!postcss' | ||
}, { | ||
test: /\.json$/, | ||
include: _paths.includePaths, | ||
loader: 'json' | ||
}, { | ||
test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2)(\?.*)?$/, | ||
include: _paths.includePaths, | ||
loader: 'file', | ||
query: { | ||
name: 'static/media/[name].[ext]' | ||
} | ||
}, { | ||
test: /\.(mp4|webm)(\?.*)?$/, | ||
include: _paths.includePaths, | ||
loader: 'url', | ||
query: { | ||
limit: 10000, | ||
name: 'static/media/[name].[ext]' | ||
} | ||
}]); | ||
|
||
newConfig.postcss = function () { | ||
return [_autoprefixer2.default]; | ||
}; | ||
|
||
// Return the altered config | ||
return newConfig; | ||
}; |
File renamed without changes.
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
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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import autoprefixer from 'autoprefixer'; | ||
import { includePaths } from '../paths'; | ||
|
||
// Add a default custom config which is similar to what React Create App does. | ||
module.exports = (storybookBaseConfig, configType) => { | ||
const newConfig = storybookBaseConfig; | ||
newConfig.module.loaders = [ | ||
...newConfig.module.loaders, | ||
{ | ||
test: /\.css?$/, | ||
include: includePaths, | ||
loader: 'style!css!postcss', | ||
}, | ||
{ | ||
test: /\.json$/, | ||
include: includePaths, | ||
loader: 'json', | ||
}, | ||
{ | ||
test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2)(\?.*)?$/, | ||
include: includePaths, | ||
loader: 'file', | ||
query: { | ||
name: 'static/media/[name].[ext]', | ||
}, | ||
}, | ||
{ | ||
test: /\.(mp4|webm)(\?.*)?$/, | ||
include: includePaths, | ||
loader: 'url', | ||
query: { | ||
limit: 10000, | ||
name: 'static/media/[name].[ext]', | ||
}, | ||
}, | ||
]; | ||
|
||
newConfig.postcss = () => { | ||
return [autoprefixer]; | ||
}; | ||
|
||
// Return the altered config | ||
return newConfig; | ||
}; |
File renamed without changes.
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
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