Coder Social home page Coder Social logo

Comments (4)

aMarCruz avatar aMarCruz commented on June 14, 2024

@DxCx hi.
Please show the file and the rollup.config.js that generates the issue?

In my tests maxEmptyLines is working Ok.

from rollup-plugin-cleanup.

DxCx avatar DxCx commented on June 14, 2024

well i was trying to see graphql-js's bundled size.
so i setup rullup, with babel, to compile the src directory of this repo:
https://github.com/graphql/graphql-js

so essentially it looks like:

import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import cleanup from 'rollup-plugin-cleanup';
import filesize from 'rollup-plugin-filesize';
import progress from 'rollup-plugin-progress';

export default {
    entry: 'graphql/src/index.js',
    format: 'cjs',
    plugins: [
      filesize(),
      progress(),
      nodeResolve({ jsnext: true, module: true }),
      commonjs({
        include: 'node_modules/**',
      }),
      babel({
        babelrc: false,
        runtimeHelpers: true,
        plugins: [
          [test.hackPlugin],
          "syntax-async-functions",
          "transform-class-properties",
          "transform-flow-strip-types",
          "transform-object-rest-spread",
          "transform-es2015-template-literals",
          "transform-es2015-literals",
          "transform-es2015-function-name",
          "transform-es2015-arrow-functions",
          "transform-es2015-block-scoped-functions",
          ["transform-es2015-classes", {loose: true}],
          "transform-es2015-object-super",
          "transform-es2015-shorthand-properties",
          "transform-es2015-duplicate-keys",
          "transform-es2015-computed-properties",
          "check-es2015-constants",
          ["transform-es2015-spread", {loose: true}],
          "transform-es2015-parameters",
          ["transform-es2015-destructuring", {loose: true}],
          "transform-es2015-block-scoping",
          "transform-regenerator",
          "transform-es3-property-literals",
          "external-helpers",
        ],
      }),
      cleanup({
        maxEmptyLines: 1,
        comments: "none",
      }),
    ],
    dest: 'dist/bundle.js',
    external: ['iterall'],
};

from rollup-plugin-cleanup.

aMarCruz avatar aMarCruz commented on June 14, 2024

@DxCx , it is working, but not as you want.
cleanup processes file by file and rollup concatenates them in a final stage, inseting blank lines between files.
Even more, it seems that the first block of bundle.js (containing classCallCheck) is inserted after cleanup did its job.

I did a test with maxEmptyLines:0 and the output is ok inside each file.

Example in original graphql/src/lenguage/lexer.js:
image

output in dist/bundle.js:
image

To act on the generated bundle, it is necessary for cleanup to work in the last rollup phase, for which it has no support, but this is something I have planned for the next minor version that will be released soon.

I will close this issue now and will ping you when the next version is ready.
Thanks for your feedback!

from rollup-plugin-cleanup.

DxCx avatar DxCx commented on June 14, 2024

sure, thanks for the support @aMarCruz :)

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.