Does not work at all
See original GitHub issueExcuse me, I’m totally stuck.
That’s my main.jsx, it has to be converted to main.min.js:
import React, { Component } from "react";
import ReactDOM from "react-dom";
ReactDOM.render(<div>lala</div>,document.getElementById("root"));
That’s my build.js script:
var fs = require("fs");
var browserify = require("browserify");
browserify("./main.jsx")
.transform("babelify",{
presets: ["react","es2015","babili"]
})
.bundle()
.pipe(fs.createWriteStream("./main.min.js"));
These are my package.json dependencies:
"babel-minify": "^0.1.12",
"babel-plugin-uglify": "^1.0.2",
"babel-preset-babili": "0.0.4",
"babel-preset-es2015": "^6.16.0",
"babel-preset-react": "^6.16.0",
"babelify": "^7.3.0",
"bootstrap-sass": "^3.3.7",
"browserify": "^13.1.0",
"classnames": "^2.2.5",
"extend": "^3.0.0",
"mobx": "^2.5.2",
"mobx-react": "^3.5.7",
"mobx-react-devtools": "^4.2.6",
"react": "^15.3.2",
"react-dom": "^15.3.2",
"uglify": "^0.1.5"
The result is main.min.jsx with filesize ~ 730KB. If I cut off babili from presets, the result is the same.
What do I do wrong?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:18 (3 by maintainers)
Top Results From Across the Web
not work at all - English translation - Linguee
Many translated example sentences containing "not work at all" – English-Spanish dictionary and search engine for English translations.
Read more >no work at all | English examples in context - Ludwig
High quality example sentences with “no work at all” in context from reliable sources - Ludwig is the linguistic search engine that helps...
Read more >Is there any difference between "it's not working" and "it doesn ...
"It doesn't work" means that something is permanently broken, or is never effective. Here are some example situations: Your television is broken. A...
Read more >How do I understand "It doesn't work all the time"?
It would be more idiomatic to say 'It doesn't work at any time', but in either case the meaning would be 'It never...
Read more >Is there something wrong if you are not working? - Quora
No, there is nothing wrong with you. No one wants to work. That's why companies have to pay people to do all of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For those who are using babili with webpack, you can try babili-webpack-plugin.
node_modules
from being run through the babel-loader, babili optimizations are not applied to the excluded files as it doesn’t pass through the minifier.Comments
Also, one more thing to note is that by default the preset doesn’t remove comments. So in your babelrc or babel config that you use for babili, you can set
comments
tofalse
.I’ve not tried babili with browserify yet, so I can’t comment much there.
I was getting poor results too because it was only doing a per-file minification. The webpack edition matched the size of UglifyJS (thanks @boopathi)
Chart for the curious.