Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

License info being included twice after Webpack 4 build #294

Closed
bruffstar opened this issue May 16, 2018 · 6 comments
Closed

License info being included twice after Webpack 4 build #294

bruffstar opened this issue May 16, 2018 · 6 comments

Comments

@bruffstar
Copy link

Webpack 4 still uses uglifyjs-webpack-plugin if mode: "production" right?

If so... see problem here...

image

Not sure if this is a Webpack/uglifyjs issue or an issue with the package that has the duplicate license info showing. (I have also opened an issue with them to investigate).

In the bundled file, no other third party scripts are adding the license info twice.

I thought it was maybe because the "classnames" package has license info in index.js, bind.js & dedupe.js. However, I ruled this out after adding a test change in the copyright text in only index.js and the change was showing on both license comments in the bundle.

Webpack: v4.8.3
NPM: v5.6.0
Node: v8.1.1

webpack.config.js
const ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = {
    mode: 'production',
    devtool: "source-maps",
    entry: "./src/js/index.tsx",
    output: {
        path: __dirname + "/dist",
        filename: "js/bundle.min.js"
    },
    resolve: {
        extensions: [".ts", ".tsx", ".js", ".json"]
    },
    module: {
        rules: [
            {
                test: /\.(ts|tsx)$/,
                use: [
                    {
                        loader: 'ts-loader'
                    }
                ]
            },
            {
                test: /\.scss$/,
                use: ExtractTextPlugin.extract({
                    use: [{
                        loader: 'css-loader',
                    }, {
                        loader: 'sass-loader'
                    }],
                    fallback: 'style-loader'
                })
            }
        ]
    },
    plugins: [
        new ExtractTextPlugin({
            filename: 'css/bundle.min.css',
            allChunks: true,
        })
    ],
    externals: {
        "react": "React",
        "react-dom": "ReactDOM"
    },
};
@bruffstar
Copy link
Author

I have made a super simple example here: https://github.com/bruffstar/bug-test

See dist/index.js for an exmaple output with the duplicate license comment.

@alexander-akait
Copy link
Member

@bruffstar thanks i will looks what is wrong and what we can do with duplicate licenses

@tsangint
Copy link

tsangint commented Sep 3, 2018

Did this resolved?

@alexander-akait
Copy link
Member

alexander-akait commented Sep 3, 2018

@tsangint no problem in uglify-es, we can't do here anything, sorry

@stevenvachon
Copy link

Duplicate of #158

@alexander-akait
Copy link
Member

@stevenvachon not quite, it will be bug in uglify-es

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants