Created
February 24, 2017 22:15
-
-
Save jwill9999/593711a24370efac6bb2f2df47303aa0 to your computer and use it in GitHub Desktop.
Reactjs Webpack Dev Server
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
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