Comments (4)
@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.
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.
@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:
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.
sure, thanks for the support @aMarCruz :)
from rollup-plugin-cleanup.
Related Issues (20)
- Errors out on spread operator HOT 5
- Pass more options to acorn parser HOT 6
- Not cleaning up properly /**/ comments HOT 3
- Using Acorn plugins doesn't work as specified by README HOT 5
- comments: 'none' not removing all comments HOT 3
- Version 3.1.0 fails for certain template literals HOT 2
- rollup hang up when running with this plugin in node.js HOT 10
- Is this plugin still maintained? HOT 2
- when i use comments: 'none', but comments still removed HOT 2
- Does not remove comments generated by Babel
- Oddly formatted Turf.js jsDoc comments not removed HOT 2
- Using hooks as filters
- 'lineEndings: "mac"' disrupts generated sourcemap
- Doesn't work for d.ts files
- Options typing
- Maintain comments starting with /*! HOT 5
- Rollup.js: cleanup didn't generate a sourcemap for the transformation HOT 2
- Empty line after deleting comment HOT 5
- blank lines within template literals are erroneously removed HOT 2
- feature request: removing arbitrary chunks of code HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rollup-plugin-cleanup.