Comments (6)
I'm currently at work, so I'm just asking/suggesting this in hope that it's a fast way to fix your problem, or to help me debugging it later:
Have you tried to specify the namespace option?
{
console: true, // Keep console logs
debugger: true // Keep debugger; statements
pragmas: ['validation', 'development'], // Keep pragmas with the following identifiers
namespace: ['App.logger', 'App.bucket'] // Besides console also remove function calls in the given namespace,
replace: '0' // For the ones who don't know how to write Javascript...
}
I believe that if you do namespace: ['logger']
it would suffice to remove all methods of that object, if it's not happening, then yes it's a bug, and I will try to take a look into it in a few hours... =)
from groundskeeper.
Yes I tried the namespaces option, but to no avail. For some reason it stripped all code from the file! It may be that it works in the general case but fails in some edge case in my code. Let me know if you observe the same. If it works for you, I'll try to create a reduced test case.
Also, there's no massive rush to fix :) using deeper namespaces such as "logger.log"
is an acceptable workaround for now
from groundskeeper.
thanks for testing the option, I'll try to replicate the bug and patch it as soon as I can :)
from groundskeeper.
Update: I just tested and it does seem to work as you expected on a much simpler file. I'll try to narrow down it down to the offending code
from groundskeeper.
I don't know what's going on, it seems to be working perfectly now. I tested and re-tested before posting this issue, but alas I must have made a mistake somewhere along the way :) I'll close this now, apologies for wasting your time.
Thanks for the great work by the way, just what I needed!
from groundskeeper.
Glad you could find the solution.
You didn't waste my time at all, in fact I appreciate the feedback and to know that people use the tool :)
from groundskeeper.
Related Issues (19)
- Partial matching console.log HOT 3
- Using it as part of a grunt Task HOT 1
- Alerts removal HOT 1
- namespace options strips out entire files HOT 4
- namespace should accept a list of namespaces HOT 2
- TypeError: Cannot read property 'type' of undefined at Groundskeeper.removeNamespace HOT 2
- Add variables to namespace in runtime
- How do I use this grunt plugin on multiple js files - when replacing (rewriting the original file and not outputting to a new one) HOT 1
- Allow the removal of personalized statements HOT 1
- The console cleaner conflicts with some libraries HOT 2
- [Enhancement] Recognizing - and _ characters in pragmas HOT 5
- Trailing directives break groundskeeper
- Mismatched pragmas cause unpredictable output HOT 2
- Prevent custom loggers to break groundskeeper
- Add test for a (not so) commonly used pattern
- Replace option should be enabled by default HOT 1
- Console removal fails with "Cannot read property 'type' of undefined" HOT 2
- Add a warn-only option to Groundskeeper HOT 1
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 groundskeeper.