jlongster/backend-with-webpack

can find module for 'scss' file

Opened this issue · 0 comments

gulp.task('client-server', function(cb){


    var nodeModules = {};
    fs.readdirSync('node_modules')
    .filter(function(x) {
        return ['.bin'].indexOf(x) === -1;
    })
    .forEach(function(mod) {
        nodeModules[mod] = 'commonjs ' + mod;
    });
    console.log(`start client-server ${SERVER_JS_PATH}`)
    webpack({
        entry: {
            server: "./src/client/static/js/server.js"
        },
        output: {
            filename: 'server.js',
            path: SERVER_JS_PATH
        },
        plugins:[
            new webpack.IgnorePlugin(/\.(css|scss)$/),
            new webpack.NormalModuleReplacementPlugin(/\.(css|scss)$/, 'node-noop')
        ],
        externals: nodeModules,
        module: {
            loaders:[
                {
                    test: /\.(js|jsx)$/,
                    exclude: /node_modules/,
                    loader: 'babel'
                }
            ]
        }
    }, function(err, stats){
        if(err){
            console.log(err)
        } else {
            cb()
        }
    })
})

after compling for server.js , when run it , throw Error: Cannot find module "./index.scss"