Skip to content
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

Rollup v2 #225

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const rollup = require('rollup');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems better to move this logic outside of the core package, either in a dedicated one (with a peer dependency on @avro/types) or in client code:

  • It reduces bloat in the main package; most clients don't use rollup.
  • It allows clients to configure rollup options (e.g. they might not want to use terser).
  • IIUC there are also benefits to rolling up more packages together, so it's counter-productive to bundle just this one separately.

Copy link
Author

@hath995 hath995 Mar 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never meant to actually commit this file (or the updated dependencies in package.json). This was there so that you could try to run the config I was using. I planned on removing it for any final pr.

const resolve = require('rollup-plugin-node-resolve');
const cjs = require('rollup-plugin-commonjs');
const terser = require('rollup-plugin-terser').terser;
const builtins = require('rollup-plugin-node-builtins');

async function build() {
const avsc = await rollup.rollup({
input: './etc/browser/avsc-types.js',
plugins: [
builtins(),
//nodeglobals(),
resolve({browser: true /*,preferBuiltins: false*/ }),
cjs(),
terser(),
]
})

await avsc.write({
name: "leader",
format: 'iife',
file: './avsc.js',
sourcemap: true
});

}
build().catch(err => {
console.error(err)
})
Loading