DrewML/webpack-emit-all-plugin

Cannot read property 'afterCompile' of undefined

ArtemSkok opened this issue · 0 comments

I get 'Cannot read property 'afterCompile' of undefined' error while bundling.

package.json :
{
...
devDependencies:
{
...
"webpack": "2.2.1",
"webpack-emit-all-plugin": "^2.0.1",
...
}
...
}

webpack.config.js :

const CopyWebpackPlugin = require('copy-webpack-plugin');
const EmitAllPlugin = require('webpack-emit-all-plugin');
const helpers = require('./helpers');
const webpack = require('webpack');

module.exports = {
entry: './main.ts',

target: 'node',

resolve: {
    extensions: ['.ts', '.js']
},

output: {
    filename: '[name].js'
},

module: {
    rules: [
        {
            test: /\.ts$/,
            loaders: [
                {
                    loader: 'awesome-typescript-loader',
                    options: {
                        configFileName: helpers.root('', 'tsconfig-electron.json')
                    }
                },
            ]
        },
    ],
},

devtool: 'cheap-module-eval-source-map',

plugins: [
    new CopyWebpackPlugin([{
        from: helpers.root('src', 'assets'), to: helpers.root('build', 'assets')
    }]),
    new EmitAllPlugin({
        ignorePattern: /node_modules/,
        path: helpers.root('bundle')
    })
],

};