-
-
Save gangstaJS/7739fd7995d2a9a7113d5b3bf0fdb467 to your computer and use it in GitHub Desktop.
webpack less -> css with source maps via extracttextplugin
This file contains hidden or 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"); | |
| 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