Closed kellyrmilligan closed 8 years ago
In what way does it break it?
On Apr 19, 2016, at 12:50 PM, Kelly notifications@github.com wrote:
any ideas on this? I like the filtering functionality and was wanting to use it with webpack.
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub
well, it does't break the process, but the resulting file is not minified at all. when I take out confidence, its fine. so the app still works,but somehow breaks uglify.
I've created a working port of the store that doesn't use hoek or boom, and uses lodash instead for the boom equivalent functions. works like a charm. I feel like client side apps can use this sort of module ,but don't need all of what comes with this currently. I may post it as a module and link back to confidence, is there a proper way to do that?
and it solved the minification issue.
If you could post a demo, it would be super helpful.
On Apr 19, 2016, at 1:21 PM, Kelly notifications@github.com wrote:
well, it does't break the process, but the resulting file is not minified at all. when I take out confidence, its fine. so the app still works,but somehow breaks uglify.
— You are receiving this because you commented. Reply to this email directly or view it on GitHub
sure, demo for which one? how it breaks uglify, or the port? and I realized earlier I meant hoek equivalent functions
The breakage
On Apr 19, 2016, at 6:59 PM, Kelly notifications@github.com wrote:
sure, demo for which one? how it breaks uglify, or the port?
— You are receiving this because you commented. Reply to this email directly or view it on GitHub
ping @kellyrmilligan
my bad. Closing for now as I won't have time to do demo of it.
@patrickkettner having this issue as well, here's the error it's outputting in my gulp task:
[17:51:42] { [Error: scripts.js from UglifyJs
Unexpected token: operator (>) [./~/confidence/lib/store.js:46,0]]
message: 'scripts.js from UglifyJs\nUnexpected token: operator (>) [./~/confidence/lib/store.js:46,0]',
showStack: false,
showProperties: true,
plugin: 'webpack-stream',
__safety: { toString: [Function: bound ] } }
Though not very helpful, backing off to previous version from NPM (1.4.2
) seems to be a workaround.
UglifyJs is kind of abandoned, it won't understand ES6, you have to transpile it first.
@Marsup right, which I am (transpiling).
In the correct order ?
I believe so -- I'm using webpack, which I'm pretty sure runs code through the loaders first (babel/transpiling), then passes on to plugins (uglify/minifying).
Are you able to share your port @kellyrmilligan - even if it is rough around the edges?
Yes it's on npm as conf-store
From before I thought maybe it had to do with some of the crypto stuff included with condfidence
@kellyrmilligan Nice one cheers! 🎉 Saved me from rolling my own. I like the confidence API format and filter mechanism, but does appear to be incompatible with Webpack Uglify for the time being, and imports a bunch of server-only dependencies.
For reference, I found that the dependency 'hoek' exports a non-es5 'let' statement. Since babel is configured to ignore node_modules by default, it gets through to uglify where it then fails. I could specifically make an allowance to force babel to transpile it, but this is when I realised how much confidence is pulling into my app simply to allow me for convenient config manager. Opting to use something like confidence to setup the config and inject it at build time, rather than running it at run time seems like a longer + cleaner objective.
For me it didn't fail, it just didn't come out uglified. I use my port with its cli wrapper to do just what you describe. It filters it and produces a Json file that I then import in my app with Json loader
any ideas on this? I like the filtering functionality and was wanting to use it with webpack.