Created
February 13, 2016 10:40
-
-
Save kriwil/0d250fa4873b9489eb96 to your computer and use it in GitHub Desktop.
webpack
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
/* ex: set tabstop=2 shiftwidth=2 expandtab: */ | |
var path = require("path"); | |
var webpack = require("webpack"); | |
var autoprefixer = require("autoprefixer"); | |
module.exports = { | |
devtool: "eval", | |
entry: [ | |
"webpack-dev-server/client?http://localhost:3000", | |
"webpack/hot/only-dev-server", | |
"./src/index" | |
], | |
output: { | |
path: path.join(__dirname, "dist"), | |
filename: "bundle.js", | |
publicPath: "/static/" | |
}, | |
plugins: [ | |
new webpack.HotModuleReplacementPlugin() | |
], | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
loaders: ["react-hot", "babel"], | |
include: path.join(__dirname, "src") | |
}, | |
{ | |
test: /\.css$/, | |
loader: "style-loader!css-loader!postcss-loader", | |
include: path.join(__dirname, "src") | |
} | |
] | |
}, | |
postcss: [ | |
autoprefixer({ | |
browsers: ["last 2 versions"] | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment