Closed RanzQ closed 8 years ago
Hi @RanzQ, thanks for the commit and research!
I am questioned a bit though about the solution.
It adds extra production transform and a dependency, which is no-good for performance and deps number, and all that just for a few lines of code.
Also I am not sure if all of my code is strict
and all the following code will be strict
, therefore I should add linter or some checker to ensure that.
I would rather go for explicit adding use strict
directives.
I am not very contented with the brfs
actually, but I don’t see an easier way to include index.css
into package.
You can try browserify -g strictify
global transform by the way.
I have made an update with 'use strict';
statements, please check 1.8.12.
@dfcreative Adding dependencies that do such small things is not cool, you're right. Your solution is fine too (tested and works). I'm using ES6 with Babel myself, so strict mode is automatic. I don't know a case when one should not use strict.
@RanzQ completely agreed. I find it wearisome though declaring 'use strict' each and other time, we already have enough of boilerplate code in js, but it appeared that it gives bonuses like validity checks etc. I found 4 errors by that in settings-panel.
Funny enough, first gotcha of strict mode - prohibited declaration of function within if/else block. That broke settings-panel in mobile safari.
Added
'strictify'
transform to include'use strict';
in every module. For some reason this solves a problem with eval in Webpack dev mode.After this,
settings-panel
works withify-loader
.