Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React fragments #37

Merged
merged 8 commits into from Jan 13, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

This file was deleted.

@@ -0,0 +1,11 @@
{
"plugins": [
["@babel/plugin-transform-runtime"]
],
"presets": [
["@babel/preset-env"],
["@babel/preset-es2015"],
["@babel/preset-stage-0"],
["@babel/preset-react"]
]
}
@@ -6,20 +6,51 @@
// 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.

const path = require('path');
const webpack = require('webpack');

module.exports = {
plugins: [
new webpack.DefinePlugin({
SOCKET_URL: JSON.stringify('wss://localhost:3000'),
}),
],
module: {
rules: [
{
test: /\.css$/,
use: [ 'style-loader', 'css-loader' ]
}
]
}
// load the default config generator.
const genDefaultConfig = require('@storybook/react/dist/server/config/defaults/webpack.config.js');

module.exports = (baseConfig, env) => {
const config = genDefaultConfig(baseConfig, env);

// Extend it as you need.

// For example, add typescript loader:
// config.module.rules.push({
// test: /\.(ts|tsx)$/,
// include: path.resolve(__dirname, '../src'),
// loader: require.resolve('ts-loader')
// });
// config.resolve.extensions.push('.ts', '.tsx');

const updatedRules = [];

config.module.rules.map((rule) => {
const ruleTest = rule.test.toString().replace('/', '').replace('?$/', '').replace('\\.', '');

if (ruleTest !== 'jsx') {
updatedRules.push(rule);
}
});

updatedRules.unshift({
test: [/\.js$|.jsx$/],
exclude: [/node_modules|public/],
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-env'],
],
},
});

config.module.rules = updatedRules;

config.plugins.push(new webpack.DefinePlugin({
SOCKET_URL: JSON.stringify(process.env.SOCKET_URL ? process.env.SOCKET_URL : 'wss://localhost:3000'),
}));

return config;
};
@@ -1,7 +1,7 @@
language: node_js

node_js:
- 8.9.3
- 8.9.4

sudo: required

@@ -1,16 +1,30 @@
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.6.0

- Changed - Support for JSX fragments.

## 1.5.0

- Added - Support for SCSS. Removed CSS in favour of SCSS.

## 1.4.0

- Added - Storybook stories.

## 1.3.0
### Changed
- Converted tests from Mocha to Jest.

- Changed - Converted tests from Mocha to Jest.

## 1.1.0
### Added
- Support for Prettier npm package.

- Added - Support for Prettier npm package.

## 1.0.0

- Initial Project release.
@@ -0,0 +1,17 @@
npm i --save-dev babel-loader@^8.0.0-beta.0 @babel/core@7.0.0-beta.36 @babel/preset-react@7.0.0-beta.36 @babel/plugin-transform-react-display-name@7.0.0-beta.36 @babel/plugin-transform-react-jsx-self@7.0.0-beta.36 @babel/plugin-syntax-jsx@7.0.0-beta.36 @babel/plugin-transform-react-jsx@7.0.0-beta.36 @babel/plugin-transform-react-jsx-source@7.0.0-beta.36 @babel/preset-stage-0@7.0.0-beta.36 @babel/preset-es2015@7.0.0-beta.36 @babel/preset-es2017@7.0.0-beta.37 @babel/preset-env@7.0.0-beta.36 @babel/plugin-transform-runtime@7.0.0-beta.36 @babel/runtime@7.0.0-beta.36

npm un babel-cli babel-core babel-eslint babel-loader babel-plugin-transform-runtime babel-polyfill babel-preset-env babel-preset-es2015 babel-preset-react babel-preset-stage-0 babel-register babel-runtime babel-watch

"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^8.1.2",
"babel-loader": "^7.1.2",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.26.0",
"babel-runtime": "^6.26.0",
"babel-watch": "^2.0.7",
@@ -21,4 +21,7 @@ module.exports = {
'client/subscribers/*',
'client/reducers/*',
],
transform: {
'^.+\\.js|jsx$': './jest.transform.js',
},
};
@@ -0,0 +1,8 @@
// Custom Jest transform implementation that wraps babel-jest and injects our
// babel presets, so we don't have to use .babelrc.

/* eslint-disable import/no-extraneous-dependencies */

module.exports = require('babel-jest').createTransformer({
presets: ['es2015', 'react'],
});
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.