Skip to content

Commit

Permalink
Merge pull request #849 from Debananda/master
Browse files Browse the repository at this point in the history
Updated the whole package dependacies to the latest using React 16.8, Webpack 4
  • Loading branch information
ryanlanciaux committed Jul 2, 2019
2 parents f836fc3 + 142696b commit a2b67c1
Show file tree
Hide file tree
Showing 23 changed files with 17,397 additions and 7,509 deletions.
18 changes: 10 additions & 8 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"env": {
"development": {
"presets": ["es2015", "stage-0", "react"]
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": ["@babel/plugin-proposal-class-properties"]
},
"build": {
"plugins": ["lodash"],
"presets": ["es2015", "stage-0", "react"],
"ignore": [
"**/__tests__/*.js",
"**/fake-*"
]
"plugins": ["lodash", "@babel/plugin-proposal-class-properties"],
"presets": ["@babel/preset-env", "@babel/preset-react"],
"ignore": ["**/__tests__/*.js", "**/fake-*"]
},
"test": {
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": ["@babel/plugin-proposal-class-properties"],
"only": ["./**/*.js", "node_modules/jest-runtime"]
}

}
}
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"arrowParens": "always"
}
4 changes: 2 additions & 2 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { configure } from '@kadira/storybook';
import { configure } from '@storybook/react';

function loadStories() {
require('../stories');
require('../stories/index.tsx');
}

configure(loadStories, module);
53 changes: 53 additions & 0 deletions .storybook/webpack-build.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const path = require('path');
const include = path.resolve(__dirname, '../');

// you can use this file to add your custom webpack plugins, loaders and anything you like.
// This is just the basic way to add addional webpack configurations.
// For more information refer the docs: https://goo.gl/qPbSyX

// IMPORTANT
// When you add this file, we won't add the default configurations which is similar
// to "React Create App". This only has babel loader to load JavaScript.

module.exports = {
devtool: 'source-map',
entry: './stories/index.tsx',
output: {
path: path.join(__dirname, '/dist/examples/'),
filename: 'storybook.js'
},
resolve: {
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js']
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: [
{
loader: 'babel-loader'
},
{
loader: 'awesome-typescript-loader'
},
{
loader: 'react-docgen-typescript-loader'
}
],
exclude: ['/node_modules/']
},
{
test: /\.(js|jsx)$/,
use: [
{
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
}
],
exclude: ['/node_modules/']
}
]
}
};
54 changes: 15 additions & 39 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,17 @@
const failPlugin = require('webpack-fail-plugin');
const path = require("path");
const include = path.resolve(__dirname, '../');

// you can use this file to add your custom webpack plugins, loaders and anything you like.
// This is just the basic way to add addional webpack configurations.
// For more information refer the docs: https://goo.gl/qPbSyX

// IMPORTANT
// When you add this file, we won't add the default configurations which is similar
// to "React Create App". This only has babel loader to load JavaScript.

module.exports = {
devtool: 'source-map',
entry: './stories/index.tsx',
output: {
filename: include + '/dist/examples/storybook.js'
},
plugins: [
failPlugin
],
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: ["", ".webpack.js", ".web.js", ".ts", ".tsx", ".js"]
},
module: {
loaders: [
{ test: /\.tsx?$/,
loader: 'babel-loader!ts-loader',
exclude: /node_modules/,
cacheDirectory: true,
include,
const path = require('path');
module.exports = (baseConfig, env, config) => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{ loader: 'babel-loader' },
{
loader: 'awesome-typescript-loader'
},
{
loader: 'react-docgen-typescript-loader'
}
],
},
ts: {
compilerOptions: {
noEmit: false,
},
},
]
});
config.resolve.extensions.push('.ts', '.tsx');
return config;
};
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.formatOnSave": true
}
Loading

0 comments on commit a2b67c1

Please sign in to comment.