Skip to content

Instantly share code, notes, and snippets.

@jrop
Created September 30, 2016 19:02
Show Gist options
  • Save jrop/134a62c66a14db2732fa4b06b6389711 to your computer and use it in GitHub Desktop.
Save jrop/134a62c66a14db2732fa4b06b6389711 to your computer and use it in GitHub Desktop.
Webpack Config for react-toolbox
{
"name": "react-toolbox-sandbox",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack --progress",
"buildw": "webpack -w --progress",
"buildp": "NODE_ENV=production webpack --progress",
"clean": "rm -rf build/"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.16.0",
"babel-loader": "^6.2.5",
"babel-preset-latest": "^6.16.0",
"babel-preset-react": "^6.16.0",
"css-loader": "^0.25.0",
"immutability-helper": "^2.0.0",
"material-design-icons": "^3.0.1",
"node-sass": "^3.10.1",
"react": "^15.3.2",
"react-addons-css-transition-group": "^15.3.2",
"react-dom": "^15.3.2",
"react-toolbox": "^1.2.1",
"sass-loader": "^4.0.2",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webpack": "^1.13.2"
}
}
'use strict'
const webpack = require('webpack')
const PROD = process.env.NODE_ENV == 'production'
module.exports = {
devtool: !PROD ? '#source-map' : '',
entry: {
'app': './src/app',
},
output: {
filename: '[name].js',
path: `${__dirname}/build/`,
},
module: {
loaders: [ {
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
}, {
test: /\.css$/,
loader: 'style!css',
}, {
test: /\.scss$/,
loader: 'style!css?modules&localIdentName=[name]_[local]_[hash:base64:5]!sass',
}, {
test: /\.(eot|svg|ttf|woff|woff2)$/,
loader: 'url',
} ],
},
plugins: PROD ? [
new webpack.optimize.UglifyJsPlugin({
comments: false,
compress: { warnings: false },
minimize: true,
}),
] : [],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment