Skip to content

Instantly share code, notes, and snippets.

@jwill9999
Created February 24, 2017 22:15
Show Gist options
  • Save jwill9999/593711a24370efac6bb2f2df47303aa0 to your computer and use it in GitHub Desktop.
Save jwill9999/593711a24370efac6bb2f2df47303aa0 to your computer and use it in GitHub Desktop.
Reactjs Webpack Dev Server
var webpack = require("webpack");
module.exports = {
entry: "./src/js/index.js",
output: {
path: "dist/assets",
filename: "bundle.js",
publicPath: "assets"
},
devServer: {
inline: true,
colors: true,
contentBase: './dist',
port: 3000,
historyApiFallback: true
},
module: {
loaders: [{
test: /\.js$/,
exclude: /(node_modules)/,
loader: ["babel-loader"],
query: {
presets: ["latest", "stage-0", "react"]
}
}, {
test: /\.json$/,
exclude: /(node_modules)/,
loader: "json-loader"
}, {
test: /\.css$/,
loader: 'style-loader!css-loader!autoprefixer-loader'
}, {
test: /\.scss$/,
loader: 'style-loader!css-loader!autoprefixer-loader!sass-loader'
}]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment