mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-20 05:02:37 +08:00
Fix storyshots
This commit is contained in:
parent
8686c6821f
commit
49ff47bde1
@ -37,6 +37,7 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@storybook/addons": "3.4.0-rc.3",
|
||||
"@storybook/core": "3.4.0-rc.3",
|
||||
"babel-core": "^6.26.0 || ^7.0.0-0"
|
||||
}
|
||||
}
|
||||
|
2
addons/storyshots/src/angular/loader.js
vendored
2
addons/storyshots/src/angular/loader.js
vendored
@ -22,7 +22,7 @@ function load(options) {
|
||||
|
||||
const { content, contextOpts } = loadConfig({
|
||||
configDirPath: options.configPath,
|
||||
babelConfigPath: '@storybook/angular/dist/server/babel_config',
|
||||
babelConfigPath: '@storybook/angular/dist/server/config/babel',
|
||||
});
|
||||
|
||||
runWithRequireContext(content, contextOpts);
|
||||
|
@ -1,10 +1,11 @@
|
||||
import path from 'path';
|
||||
import { loadBabelConfig } from '@storybook/core/server';
|
||||
|
||||
const babel = require('babel-core');
|
||||
|
||||
function getConfigContent({ resolvedConfigDirPath, configPath, babelConfigPath }) {
|
||||
const loadBabelConfig = require.requireActual(babelConfigPath).default;
|
||||
const babelConfig = loadBabelConfig(resolvedConfigDirPath);
|
||||
const defaultBabelConfig = require.requireActual(babelConfigPath).default;
|
||||
const babelConfig = loadBabelConfig(resolvedConfigDirPath, defaultBabelConfig);
|
||||
return babel.transformFileSync(configPath, babelConfig).code;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ function test(options) {
|
||||
function load(options) {
|
||||
const { content, contextOpts } = loadConfig({
|
||||
configDirPath: options.configPath,
|
||||
babelConfigPath: '@storybook/react/dist/server/babel_config',
|
||||
babelConfigPath: '@storybook/react/dist/server/config/babel',
|
||||
});
|
||||
|
||||
runWithRequireContext(content, contextOpts);
|
||||
|
@ -17,7 +17,7 @@ function load(options) {
|
||||
|
||||
const { content, contextOpts } = loadConfig({
|
||||
configDirPath: options.configPath,
|
||||
babelConfigPath: '@storybook/vue/dist/server/babel_config',
|
||||
babelConfigPath: '@storybook/vue/dist/server/config/babel',
|
||||
});
|
||||
|
||||
runWithRequireContext(content, contextOpts);
|
||||
|
@ -1,5 +1,6 @@
|
||||
const assign = require('babel-runtime/core-js/object/assign').default;
|
||||
const defaultWebpackConfig = require('./dist/server/config/defaults/webpack.config');
|
||||
const loadBabelConfig = require('./dist/server/babel_config').default;
|
||||
const configLoaderCreator = require('./dist/server/config').default;
|
||||
const serverUtils = require('./dist/server/utils');
|
||||
const buildStatic = require('./dist/server/build-static');
|
||||
@ -8,4 +9,5 @@ const buildDev = require('./dist/server/build-dev');
|
||||
module.exports = assign({}, defaultWebpackConfig, buildStatic, buildDev, serverUtils, {
|
||||
managerPath: require.resolve('./dist/client/manager'),
|
||||
configLoaderCreator,
|
||||
loadBabelConfig,
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user