roman01la / webpack-closure-compiler

[DEPRECATED] Google Closure Compiler plugin for Webpack
MIT License
464 stars 25 forks source link

EPIPE error with React project #30

Closed shashwattt-Pretlist closed 6 years ago

shashwattt-Pretlist commented 7 years ago

Trying to implement for optimisation, getting error as, any help or suggestion appreciated.

events.js:160 throw er; // Unhandled 'error' event ^ Error: write EPIPE at exports._errnoException (util.js:1012:11) at WriteWrap.afterWrite (net.js:793:14)

My config.js is as follows

var webpack = require('webpack');
var ClosureCompilerPlugin = require('webpack-closure-compiler');

module.exports = {
    entry: {
        main: './src/index.js',
        vendor: ['moment', 'pubsub-js', 'socket.io-client', 'axios', 'react', 'react-router'],
    },
    output: {
        path: './build/',
        filename: 'static/js/bundle.js',
        //chunkFilename: 'static/js/[id].bundle.js',
    },
    devServer: {
        compress:true,
        inline: true,
        port: 3333
    },
    module: {
        loaders: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                loader: 'babel-loader',
                query: {
                    // stage: 0,
                    presets: ["react", "es2015", "stage-0"],
                    plugins: ['./relay_build/babelRelayPlugin'].map(require.resolve)
                }
            },
            {
                loader: 'json-loader',
                test: /\.json$/
            },
            {
                test: /\.scss$/,
                loaders: ['style-loader', 'css-loader', 'sass-loader']
            },
            {
                test: /\.(gif|jpe?g|png|ico)$/,
                loader: 'url-loader?limit=10000'
            },
            {
                test: /\.(otf|eot|svg|ttf|woff|woff2).*$/,
                loader: 'url-loader?limit=10000'
            }
        ]
    },
    plugins: [
    new ClosureCompilerPlugin({
          compiler: {
            language_in: 'ECMASCRIPT6',
            language_out: 'ECMASCRIPT5',
            compilation_level: 'ADVANCED'
          },
          concurrency: 3,
        })
  ],
}
roman01la commented 7 years ago

@shashwattt-Pretlist A minimal repro would help to understand what's going on there. Thanks.

mhdatie commented 7 years ago

Experiencing same issue. Not using the plugin makes it work.

jarofghosts commented 7 years ago

I have the same issue, but it doesn't occur if I use the jsCompiler: true option.

HoraceShmorace commented 7 years ago

I had this problem on my Mac. You simply need to install the Java SDK. http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

The compiler uses Java. jsCompiler: true will use the pure JS compiler, which is why @jarofghosts could get around this issue.

It should be called out as a system requirement in the README.

roman01la commented 7 years ago

@HoraceShmorace Thanks!

@shashwattt-Pretlist please let us know if this solves your issue

roman01la commented 7 years ago

@HoraceShmorace FYI, I've added Requirements section which refers to Java SDK dependency https://github.com/roman01la/webpack-closure-compiler#requirements

roman01la commented 6 years ago

closing due to no activity