Skip to content

Instantly share code, notes, and snippets.

@sorentwo
Created November 12, 2015 03:26
Show Gist options
  • Save sorentwo/c565b063b66f4b9cbb3c to your computer and use it in GitHub Desktop.
Save sorentwo/c565b063b66f4b9cbb3c to your computer and use it in GitHub Desktop.
Webpack with extract text
var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin")
module.exports = {
entry: "./web/static/app/app.js",
output: {
path: "./priv/static/js",
filename: "app.js"
},
module: {
loaders: [
{ test: /\.coffee$/, loader: 'coffee-loader' },
{ test: /\.(js|jsx)$/, loader: "babel-loader", exclude: /node_modules/ },
{ test: /\.scss$/, loader: ExtractTextPlugin.extract("css!autoprefixer!sass?outputStyle=compact") }
]
},
resolve: {
extensions: ["", ".js", ".jsx", ".coffee"]
},
plugins: [
new ExtractTextPlugin("../css/app.css", {
allChunks: true
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment