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
{ | |
"name": "webpack-cs-ltc", | |
"version": "1.0.0", | |
"description": "A simple boilerplate for Webpack 3, dynamic imports, code splitting, and long term caching.", | |
"main": "index.js", | |
"scripts": { | |
"start": "webpack --config webpack.config.js", | |
"dev-server": "webpack-dev-server", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, |
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
Show hidden characters
{ | |
"presets": [ | |
"react", | |
["env", { | |
"targets": { | |
"browsers": ["last 2 versions"] | |
} | |
}], | |
"stage-0" | |
], |
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
const webpack = require('webpack'); | |
const path = require('path'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const APP_DIR = path.resolve(__dirname, './src'); | |
const MODULES_DIR = path.resolve(__dirname, './node_modules'); | |
const package = require('./package.json'); | |
module.exports = { |
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
//// MyComponent/MyComponent.js | |
const MyComponent = ({class, text, setText}) => ( | |
<div | |
className={class} | |
onClick={setText} | |
>{text}</div> | |
) | |
export default MyComponent | |
//// |
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
const { compose, mapProps, withHandlers, lifecycle } = Recompose; | |
const { observable, action } = mobx; | |
const { inject, observer, Provider } = mobxReact; | |
const { PropTypes } = React; | |
// store | |
// ============================ | |
const counterStore = observable({ | |
// for primitive values, wrap the value inside a observable, | |
// or wrap it in an plain js object |
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
export default (fn, ...args) => (e) => { | |
e.preventDefault(); | |
fn(...args); | |
}; |