New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work at all #172
Comments
Hi @Kasheftin, have you added Example from the docs
|
I'm getting the same result with the following {
"presets": [
"modern-browsers/webpack2",
"react"
],
"env": {
"production": {
"presets": [
"modern-browsers/webpack2",
"babili",
"react"
]
},
"test": {
"presets": [
"es2015"
]
}
}
} Does the order of the presets list matter to Webpack or Babel? |
I don't have neither .babelrc nor package.json config for babili. I suppose that's just different ways to specify configuration. I have this configuration included in my node script. I've just added both .babelrc and package.json section (without env, just presets:["react","es2015","babili"]) but still can't see any difference. |
@Kasheftin I have a setup similar to yours and I'm getting this error |
@lmj0011 Looks like you have the wrong preset name. The preset name is |
I also can't get babili to work (either using the babel preset or the webpack plugin). The babel preset doesn't seem to have any affect at all. The webpack plugin does reduce the size of the bundles, but then I get a bunch of TypeErrors in the browser. Hopefully it's just bugs that will get worked out, but I don't know what is going on. I'm willing to try any suggestions. |
Not sure why you guys are having issues. I'm using Webpack 2, but this has been working for us. {
test: /\.(js|jsx)$/,
exclude: /(node_modules)/,
loader: 'babel',
query: {
presets: ['es2015', 'babili'],
},
}, Not even sure if we need the |
@dmackerman what's the difference in your file sizes, with and without |
@rxgx our bundle in development mode is around 6.5MB. After babili it comes down to around 2? Then after gzipping everything gets down to around 500k (We need to do further optimizations) 😄 |
I've tried all manner of adding, removing, and re-ordering presets and plugins and can't get When not using
If I use: {
test: /\.jsx?$/,
include: path.join(__dirname, 'src'),
exclude: /node_modules/,
loader: 'babel',
query: {
babelrc: false,
"presets": [
"babili",
"react",
"es2015",
"stage-0",
],
}
} Then I get:
If I remove the include/exclude statements (don't we want
I'm just at a loss on how to proceed. By the way, UglifyJS can get my main.min.js file down to 1.26 MB. In regards to node_modules, wouldn't we want a minifier to process all code (including third party modules)? In this respect I think |
I re-read the documentation I think the issue is that Babili isn't operating the same way as UglifyJS or Closure Compiler. There's only a small amount of minification due to Babili running per file rather than per bundle.
|
I haven't tried it since my last post so I don't know if any changes might have improved things for me (read: make it work at all), but I don't get the argument about speed benefits if it destroys a large part of the actual minification benefits. This isn't a tool that's going to be run much in development. For production deployment it doesn't really matter if it takes a minute longer to minify a bundle. Don't get me wrong. I know this is a beta (alpha?) project and I appreciate the work towards a new way of doing minification. I'm just offering feedback that it hasn't been working for me yet. |
For those who are using babili with webpack, you can try babili-webpack-plugin.
CommentsAlso, 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 {
presets: ["babili"],
comments: false
} I've not tried babili with browserify yet, so I can't comment much there. |
I have fallen down the same path. This does work for me, though: https://github.com/boopathi/babili-webpack-plugin. |
Is this still an issue for some folks? It seems that there's few configurations and build systems discussed here, so I'm not sure we can tackle all of them at once. Being able to operate on multiple files at once is something we want to look into in a near future (there should be a ticket for it somewhere). |
+1 I seems to do nothing when running through webpack |
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. |
Excuse me, I'm totally stuck.
That's my main.jsx, it has to be converted to main.min.js:
That's my build.js script:
These are my package.json dependencies:
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?
The text was updated successfully, but these errors were encountered: