Giter Club home page Giter Club logo

Comments (7)

xz64 avatar xz64 commented on June 18, 2024 2

Hey just wanted to give you an update: I am planning on releasing a new major version which will fix the issue

from license-webpack-plugin.

xz64 avatar xz64 commented on June 18, 2024

Sounds like a bug in this package. This plugin inserts a hook right before webpack outputs the file. I took a look at the BannerPlugin which comes with webpack, and it appears that plugin inserts a hook at a different phase https://github.com/webpack/webpack/blob/5238159d211576bb313d99d487e415f3799af795/lib/BannerPlugin.js#L50

I'll see if I can change the phase the plugin uses

from license-webpack-plugin.

zefj avatar zefj commented on June 18, 2024

@xz64 any ETA on this?

from license-webpack-plugin.

xz64 avatar xz64 commented on June 18, 2024

I have published an alpha of the next release. You can install license-webpack-plugin@next to get the alpha release. Please try it out and let me know if you are seeing the same issue there. There are some breaking changes, so please check out the dev branch (MIGRATION.md file) for some documentation on that.

from license-webpack-plugin.

SeanHayes avatar SeanHayes commented on June 18, 2024

I tried this config with the 2.0.0 alpha 6:

        new LicenseWebpackPlugin({
            licenseInclusionTest: (licenseType) => {
                return true;
            },
            unacceptableLicenseTest: (licenseType) => {
                return /GPL/i.test(licenseType);
            },
            handleUnacceptableLicense: (packageName, licenseType) => {
                throw new Error(`${packageName} has unacceptable license type: ${licenseType}`);
            },
            handleMissingLicenseText: (packageName, licenseType) => {
                console.warn(`Cannot find license for ${packageName}`);
                return 'UNKNOWN';
            },
            perChunkOutput: false,
            licenseTemplateDir: 'templates/licenses/',
            addBanner: true,
            renderBanner: (filename, modules) => {
                return '/*! licenses are at ' + filename + '*/';
            },
            additionalModules: [
                packageDirInfo('babel-polyfill'),
                packageDirInfo('font-awesome'),
                packageDirInfo('gettext-parser'),
                packageDirInfo('modernizr'),
                packageDirInfo('player.js'),
                packageDirInfo('plotly.js'),
            ],
            licenseTypeOverrides: {
                'font-awesome': 'MIT',
                'xmldom': 'MIT',
            },
        }),

The banner doesn't get added to the JS bundle, and in my production buidl, the license.txt file doesn't seem to get generated.

from license-webpack-plugin.

xz64 avatar xz64 commented on June 18, 2024

This was due to a bug where the addBanner and perChunkOutput options were switched (see #48). I have fixed it in v2.0.0-alpha.7. Please try that out and let me know if you have any issues.

from license-webpack-plugin.

SeanHayes avatar SeanHayes commented on June 18, 2024

Everything seems to be working in v2.0.0-alpha.7, thanks!

from license-webpack-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.