D
D
Deodatuss2016-03-07 11:30:16
JavaScript
Deodatuss, 2016-03-07 11:30:16

Why does webpack crash with an error?

In general, I started trying webpack. You need to glue the css files through the less file. The conf is like this:

var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {

    entry:  __dirname + '/web/less_importer.js',
    output: {
        path: __dirname + '/web/compiled',
        filename: "[name].js"
    },
    module: {
        loaders: [
            { test: /\.css$/,  loader: ExtractTextPlugin.extract("style-loader", "css-loader") },
            {
                test: /\.less$/,
                loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader")
            }
        ]
    },
    plugins: [
        new ExtractTextPlugin("[name].css")
    ]
}

less_importer.js:
var layout = require('./less/casestudystudent/layout.less');

layout.less
@import "../../bundles/casestudyfoundation/css/reset.css";
@import "../../bundles/casestudyfoundation/jquery/plugins/qtip/jquery.qtip.min.css";
@import "../../bundles/casestudyfoundation/jquery/css/smoothness/jquery-ui-1.9.2.custom.css";

Crashes with an error: ERROR in Cannot find module 'less'
All dependencies are installed. What could be the problem ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question