Crunch / postcss-less

MIT License
35 stars 9 forks source link

requiring postcss-less-engine breaks webpack #6

Open alisonailea opened 7 years ago

alisonailea commented 7 years ago

Here's the code that breaks.

/* PostCSS Style Handling */
var map = require('postcss-map');
var autoprefixer = require('autoprefixer');
var nestedAncestors = require('postcss-nested-ancestors');
var nested = require('postcss-nested');
var lessEngine = require('postcss-less-engine');

...

module: {
    loaders: [
        {
            test: /\.less$/,
        loader: ExtractLESS.extract('style-loader', ['css-loader', 'less-loader']),
        }
    ]
},
postcss: function () {
    return [
        map(),
            nestedAncestors,
        nested,
        autoprefixer,
    ]
},

ERROR Unable to load webpack configuration file "webpack.config.dev.js": Cannot find module 'postcss'

BUT this code works...

/* PostCSS Style Handling */
var map = require('postcss-map');
var autoprefixer = require('autoprefixer');
var nestedAncestors = require('postcss-nested-ancestors');
var nested = require('postcss-nested');
// var lessEngine = require('postcss-less-engine');

...
matthew-dean commented 7 years ago

I know hardly anything about webpack. Wouldn't this be a webpack issue?

alisonailea commented 7 years ago

but something about the postcss-less-engine breaks webpack simply by including it as a variable. I'm not even using it. I have webpack experience so I'll mess with it a bit and get back to you. I was just hoping there was a quick fix I was unaware of.