Coder Social home page Coder Social logo

Comments (5)

 avatar commented on June 14, 2024 1

@aMarCruz Thank you :). Gave it a shot, only problem is I'm using IIFE and the end result is the license is added within the file (instead of at the top):

var fetchInject = (function () {
'use strict';

/*!
 * Copyright (c) 2017 Josh Habdas
 * @license MIT
 */
var fetchInject = function (urls) {

Given I'm trying to use uglify with this package, and it provides support, I'll see if I can get that working instead. Thanks again!

EDIT: Just stuck with rollup-plugin-license. Seems to fit my needs and doesn't add more than I really need.

from rollup-plugin-cleanup.

 avatar commented on June 14, 2024

Also, thanks for the plug-in. It's lovely 😄

from rollup-plugin-cleanup.

aMarCruz avatar aMarCruz commented on June 14, 2024

@jhabdas thanks to you! ...I'll take a look at your recommendation, I think there will be no problem adding a predefined filter for it in the next version.

In the mean time, you can use the regex /\*!/, like in this example:

  ...
  plugins {
    cleanup({
      comments: [ 'some', /\*!/ ]
    })

Please note: comments[] will overwrite de default filters (it is not additive).
I hope this help and will close this issue.

from rollup-plugin-cleanup.

 avatar commented on June 14, 2024

Excellent. I didn't know there was a workaround. I'd like to use this plug-in in combination with the minify plugin but my comments were getting clobbered for some reason so I've switched for now. Here's my current implementation: https://github.com/jhabdas/fetch-inject/blob/master/rollup.config.js

I would prefer to keep an abbreviated license field in the dist but have not yet found a way to do so using either plugin. Cheers and thanks again for considering my proposal.

from rollup-plugin-cleanup.

aMarCruz avatar aMarCruz commented on June 14, 2024

@jhabdas , try this:

  ...
  plugins {
    cleanup({
      comments: [ 'some', /^\*!/, /MIT License/ ]
    })

from rollup-plugin-cleanup.

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.