Skip to content

Instantly share code, notes, and snippets.

View package.json
"scripts": {
"dev": "webpack-dev-server --config webpack.config.js --inline",
"deploy": "webpack -p --config webpack.config.production.js"
},
View run.sh
webpack -p --config webpack.config.production.js
View run.sh
webpack-dev-server --config webpack.config.js --inline
View webpack.config.js
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
devtool: 'eval',
devServer: { hot: true },
entry: ['./src/index.jsx'],
output: {
path: __dirname + '/dist',
View .babelrc
{
"presets": ["es2015", "react"],
"env": {
"development": {
"plugins": [["react-transform", {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
"locals": ["module"]
}]