Skip to content

webpack -p ERROR in common.js from UglifyJs Invalid assignment [common.js:45003,29] #83

@khorark

Description

@khorark

Hi. i don't create build with webpack command webpack -p. I have error

ERROR in common.js from UglifyJs
Invalid assignment [common.js:45003,29]

But create build with options webpack --env=prod run. I think problem in to compress file.

My webpack config:

const path = require('path');
const webpack = require("webpack");
const srcPath = path.resolve(__dirname, "../src");
const hostPath = path.resolve(__dirname, "developPath.json");
const host = require(hostPath);

module.exports = {
cache: true,

entry: {
    MSP2: ["babel-polyfill", 'react-hot-loader/patch', "./core/js/newCore/src/core/coreEntryPoint.js"],
    tasks: "./core/js/newCore/src/tasks/tasksEntryPoint.js",
    regulation: "./core/js/newCore/src/regulation/main.js",
    delegation: "./core/js/newCore/src/delegation/main.js",
    kpi: "./core/js/newCore/src/kpi/kpiEntryPoint.js",
    rci: "./core/js/newCore/src/rci/rciEntryPoint.js",
    rbs: "./core/js/newCore/src/rbs/rbsEntryPoint.js",
    businessProcess: "./core/js/newCore/src/businessProcesses/main.js",
    exchangeAd: "./core/js/newCore/src/exchangeAd/main.js",
},

output: {
    path: path.resolve(__dirname, "../build/"),
    filename: "[name].js",
    publicPath: "/core/js/newCore/build/",
},

resolve: {
    extensions: ['.js', '.jsx', '.json', '*'],
},

module: {
    rules: [
        { //0
            test: /\.(js|jsx)$/,
            include: [srcPath],
            use: [
                {
                    loader: 'babel-loader',
                    options: {
                        cacheDirectory: true,
                        presets: [
                            ['es2015', {modules: false}],
                            'stage-0',
                            'react',
                        ],
                        plugins: [
                            'react-hot-loader/babel',
                            'transform-decorators-legacy',
                        ],
                    },
                },
            ],
        },
        { //1
            test: /\.css$/,
            include: [srcPath],
            use: [
                'style-loader', //1-0
                { //1-1
                    loader: 'css-loader',
                    options: {
                        sourceMap: true,
                        modules: true,
                        localIdentName: '[name]__[local]__[hash:base64:5]',
                    },
                },

            ],
        },
        { //2
            test: /\.less$/,
            include: [srcPath],
            use: [
                'style-loader', //2-0
                { //2-1
                    loader: 'css-loader',
                    options: {
                        sourceMap: true,
                        modules: true,
                        localIdentName: '[name]__[local]__[hash:base64:5]',
                    },
                },
                { //2-2
                    loader: 'less-loader',
                    options: {
                        sourceMap: true,
                    },
                },
            ],
        },
        { //3
            test: /\.(png|jpg|gif|svg)$/,
            include: [srcPath],
            use: [
                {
                    loader: 'url-loader',
                    options: {
                        limit: 10000,
                    },
                },
            ],
        },
    ],
},

devServer: {
    proxy: {
        "**": {
            "target": {
                "host": host.host,
                "protocol": 'http:',
                "port": 80,
            },
            changeOrigin: true,
        },
    },
    host: 'localhost',
    port: 8090,
    //webpack-dev-server -d --hot --inline --content-base public --port 8090 --host localhost
},

plugins: [
    new webpack.DllReferencePlugin({
        context: path.join(__dirname, "dll"),
        manifest: require("./dll/vendor-manifest.json"),
    }),
    new webpack.NamedModulesPlugin(),
],

};

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions