-
Notifications
You must be signed in to change notification settings - Fork 138
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
Make browser usage more clear/compatible #653
Comments
I looked into this a bit and would appreciate some help. Based on the rollup config, the How do I get a joint es5 version that will work both as a script tag inclusion with |
What about using good old UMD? I may be wrong, because I just checked if rollup runs with the config and produces something that looks acceptable:
|
Ah yes UMD might work quite well, thank you. I tried a bit today, but I can't get this to work in combination with babel. My goal is to have an es5 compatible version that doesn't use anything fancy.
Which gives me
From there I tried a few other things, but couldn't get it to dial back its features. |
How about using Babel on the input and not as an output plugin then, which should stop the error from happening:
|
Ah this gave me the right hints. I tried this before, but the plugin location was wrong, so it tried to load babel as an output plugin even though it was not. Here is a config that seems to work: import { babel } from '@rollup/plugin-babel';
import { terser } from 'rollup-plugin-terser';
export default [{
input: 'lib/ical/module.js',
output: [
{ file: 'dist/ical.js', format: 'es', exports: 'default' },
{
file: 'dist/ical.min.js',
format: 'es',
exports: 'default',
plugins: [terser()]
}
]
},{
input: 'lib/ical/module.js',
output: [
{
file: 'dist/ical.es5.cjs',
exports: 'default',
name: 'ICAL',
format: 'umd',
},
{
file: 'dist/ical.es5.min.cjs',
exports: 'default',
name: 'ICAL',
format: 'umd',
plugins: [terser()]
}
],
plugins: [
babel({ babelHelpers: 'bundled', presets: ['@babel/preset-env'] })
]
}]; Does that look right? |
It does to me, and the output is similar to what it was before, despite the added wrapper function, how the babel helpers are included and stripped license comments. |
Thanks! I'll look into the missing license header for this one and check the others. We should have at least one at the top. |
There is at least one right before the included |
There are some breaking changes w.r.t. imports and browsers in 2.0.0. You can't simply <script src> import it there, you'll need
It isn't currently possible to simply global import
ICAL
, even with the es5 version. Tasks here:The text was updated successfully, but these errors were encountered: