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

feat: add deno target to rollup build script #281

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"devDependencies": {
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-replace": "^4.0.0",
"eslint": "^8.9.0",
"esm": "^3.2.25",
"rimraf": "^3.0.2",
Expand All @@ -55,6 +56,9 @@
},
"esm": {
"force": true,
"mainFields": ["module", "main"]
"mainFields": [
"module",
"main"
]
}
}
103 changes: 60 additions & 43 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,73 @@ import json from '@rollup/plugin-json';
import bundleSize from 'rollup-plugin-bundle-size';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
import replace from '@rollup/plugin-replace';

function onwarn(warning, defaultHandler) {
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
defaultHandler(warning);
}
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
defaultHandler(warning);
}
}

const name = 'aq';
const external = [ 'apache-arrow', 'node-fetch' ];
const external = ['apache-arrow', 'node-fetch'];
const globals = { 'apache-arrow': 'Arrow' };
const plugins = [
json(),
bundleSize(),
nodeResolve({ modulesOnly: true })
json(),
bundleSize(),
nodeResolve({ modulesOnly: true })
];

export default [
{
input: 'src/index-node.js',
external: ['acorn'].concat(external),
plugins,
onwarn,
output: [
{
file: 'dist/arquero.node.js',
format: 'cjs',
name
}
]
},
{
input: 'src/index.js',
external,
plugins,
onwarn,
output: [
{
file: 'dist/arquero.js',
format: 'umd',
globals,
name
},
{
file: 'dist/arquero.min.js',
format: 'umd',
sourcemap: true,
plugins: [ terser({ ecma: 2018 }) ],
globals,
name
}
]
}
];
{
input: 'src/index-node.js',
external: ['acorn'].concat(external),
plugins,
onwarn,
output: [
{
file: 'dist/arquero.node.js',
format: 'cjs',
name
}
]
},
{
input: 'src/index.js',
plugins: [
replace({
values: { 'apache-arrow': 'https://cdn.skypack.dev/[email protected]' },
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
values: { 'apache-arrow': 'https://cdn.skypack.dev/[email protected]' },
values: { 'apache-arrow': 'https://cdn.jsdelivr.net/npm/[email protected]/+esm' },

Note that this means arguer needs #277, I think.

preventAssignment: true,
delimiters: ['\\b', '\\b(?!@)']
}),
...plugins
],
output: [{
file: 'dist/arquero.deno.js',
format: 'es',
name
}]
},
{
input: 'src/index.js',
external,
plugins,
onwarn,
output: [
{
file: 'dist/arquero.js',
format: 'umd',
globals,
name
},
{
file: 'dist/arquero.min.js',
format: 'umd',
sourcemap: true,
plugins: [terser({ ecma: 2018 })],
globals,
name
}
]
}
];
20 changes: 20 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@
is-module "^1.0.0"
resolve "^1.19.0"

"@rollup/plugin-replace@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-4.0.0.tgz#e34c457d6a285f0213359740b43f39d969b38a67"
integrity sha512-+rumQFiaNac9y64OHtkHGmdjm7us9bo1PlbgQfdihQtuNxzjpaB064HbRnewUOggLQxVCCyINfStkgmBeQpv1g==
dependencies:
"@rollup/pluginutils" "^3.1.0"
magic-string "^0.25.7"

"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
Expand Down Expand Up @@ -1074,6 +1082,13 @@ lodash.padend@^4.6.1:
resolved "https://registry.yarnpkg.com/lodash.padend/-/lodash.padend-4.6.1.tgz#53ccba047d06e158d311f45da625f4e49e6f166e"
integrity sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=

magic-string@^0.25.7:
version "0.25.9"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c"
integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==
dependencies:
sourcemap-codec "^1.4.8"

maxmin@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/maxmin/-/maxmin-2.1.0.tgz#4d3b220903d95eee7eb7ac7fa864e72dc09a3166"
Expand Down Expand Up @@ -1372,6 +1387,11 @@ source-map@~0.7.2:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==

sourcemap-codec@^1.4.8:
version "1.4.8"
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==

string.prototype.trim@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.5.tgz#a587bcc8bfad8cb9829a577f5de30dd170c1682c"
Expand Down