Skip to content

Instantly share code, notes, and snippets.

@skynode
Forked from BinaryMuse/webpack.config.js
Created April 4, 2017 05:37
Show Gist options
  • Save skynode/7f0ec7bc4128c4eaf9520889bf7b5865 to your computer and use it in GitHub Desktop.
Save skynode/7f0ec7bc4128c4eaf9520889bf7b5865 to your computer and use it in GitHub Desktop.
webpack less -> css with source maps via extracttextplugin
var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var lessLoader = ExtractTextPlugin.extract(
"css?sourceMap!less?sourceMap"
);
module.exports = {
cache: true,
entry: { bundle: "./master/client/index.jsx" },
output: {
path: __dirname + "/master/public/js",
filename: "[name].js"
},
devtool: "source-map",
resolve: {
extensions: ["", ".webpack.js", ".web.js", ".js", ".jsx"]
},
module: {
loaders: [
{ test: /\.less$/, exclude: /node_modules/, loader: lessLoader },
{ test: /\.(eot|svg|ttf|woff|woff2)$/, exclude: /node_modules/, loader: "file" },
{ test: /\.jsx?$/, exclude: /node_modules/, loader: "babel?stage=1" }
]
},
plugins: [
new ExtractTextPlugin("styles.css", {allChunks: true})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment