Skip to content

Instantly share code, notes, and snippets.

@henrikbjorn
Created January 8, 2016 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrikbjorn/3ecc0f1bdf234d430c22 to your computer and use it in GitHub Desktop.
Save henrikbjorn/3ecc0f1bdf234d430c22 to your computer and use it in GitHub Desktop.
WebPack config for bundling js and css files using modulish require.
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry : "./src/index.jsx",
output : {
path : "dist",
filename: "bundle.js"
},
module: {
loaders: [
{ test: /\.(js|jsx)$/, exclude: /node_modules/, loader: "babel-loader" },
{ test: /\.(css)$/, exclude: /node_modules/, loader: ExtractTextPlugin.extract('css-loader') }
]
},
plugins: [
new ExtractTextPlugin('bundle.css', {
allChunks: true
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment