Skip to content

Commit

Permalink
undo unrelated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 24, 2020
1 parent 0f02747 commit ce59c05
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions packages/storybook/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
const path = require('path');
const webpack = require('webpack');

const env = process.env.NODE_ENV || 'development';
const env = process.env.NODE_ENV || 'development'
/* eslint-disable */
const __DEV__ = env === 'development';
const __PROD__ = env === 'production';
const __DEV__ = env === 'development'
const __PROD__ = env === 'production'
/* eslint-enable */

if (!(__DEV__ || __PROD__)) {
throw new Error(`Unknown env: ${env}.`);
throw new Error(`Unknown env: ${env}.`)
}
console.log(`Loading config for ${env}`);
console.log(`Loading config for ${env}`)
const maxAssetSize = 1024 * 1024;

module.exports = {
Expand All @@ -24,26 +24,26 @@ module.exports = {
'@storybook/addon-a11y/register',
],
typescript: {
check: __DEV__, // Already covered by yarn typescript
reactDocgen: false,
check: __DEV__, // Netlify is breaking the deploy with this settings on. So deactivate on release
reactDocgen: false
},
webpackFinal: async (config) => {
webpackFinal: async config => {
config.parallelism = 1;
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{
loader: require.resolve('ts-loader'),
},
}
],
});
if (__DEV__) {
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: ['source-map-loader'],
enforce: 'pre',
exclude: /node_modules/,
include: path.resolve(__dirname, '../../../packages/grid/'),
exclude: /node_modules/,
include: path.resolve(__dirname, '../../../packages/grid/')
});
}

Expand All @@ -54,7 +54,7 @@ module.exports = {
loader: require.resolve('@storybook/source-loader'),
options: {
parser: 'typescript',
prettierConfig: { printWidth: 80, singleQuote: true },
prettierConfig: {printWidth: 80, singleQuote: true},
tsconfigPath: path.resolve(__dirname, '../tsconfig.json'),
},
},
Expand All @@ -68,28 +68,25 @@ module.exports = {
options: {
search: '__RELEASE_INFO__',
replace: 'MTU5NjMxOTIwMDAwMA==', // 2020-08-02
},
}
});

config.optimization = {
splitChunks: {
chunks: 'all',
minSize: 30 * 1024,
maxSize: maxAssetSize,
},
}
};
config.performance = {
maxAssetSize: maxAssetSize,
maxAssetSize: maxAssetSize
};
config.resolve = {
...config.resolve,
extensions: ['.js', '.ts', '.tsx'],
alias: {
'@material-ui/data-grid': path.resolve(__dirname, '../../../packages/grid/data-grid/src'),
'@material-ui/x-grid-data-generator': path.resolve(
__dirname,
'../../../packages/x-grid-data-generator/src',
),
'@material-ui/x-grid-data-generator': path.resolve(__dirname, '../../../packages/x-grid-data-generator/src'),
'@material-ui/x-grid': path.resolve(__dirname, '../../../packages/grid/x-grid/src'),
'@material-ui/x-license': path.resolve(__dirname, '../../../packages/x-license/src'),
},
Expand Down

0 comments on commit ce59c05

Please sign in to comment.