I attempted to use parcel to bundle a commonJS project.
For example
const assert = require('assert')
const MyWebComponent = require('./my-web-component')| # use ImageMagick convert | |
| # the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf | |
| convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Effect": "Allow", | |
| "Action": [ | |
| "route53:*", | |
| "route53domains:*", | |
| "cloudfront:ListDistributions", | |
| "elasticloadbalancing:DescribeLoadBalancers", |
| /** | |
| * A PromiseLock like object. | |
| * | |
| * Used to ensure that we only do one thing at a time on a shared resource. | |
| * | |
| * For example, with async iterator: | |
| * | |
| * this.readLock = new Mutex() | |
| * this.readLock.do(async () => { | |
| * const data = await itr.next(); |
| const isPromise = import('./third-party-is-promise.mjs') | |
| console.log(typeof isPromise) | |
| console.log('then method', typeof isPromise.then) |
| export class ValidationFail { | |
| readonly validateErr: string | |
| readonly ok: false | |
| constructor(validateErr: string) { | |
| this.validateErr = validateErr | |
| this.ok = false | |
| } | |
| } | |
| export class ValidationSuccess<T> { |
| $ npm pack @pre-bundled/[email protected] | wc -l | |
| npm http fetch GET 200 https://registry.npmjs.org/@pre-bundled%2ftape 13ms (from cache) | |
| npm http fetch GET 200 https://registry.npmjs.org/@pre-bundled%2ftape 5ms (from cache) | |
| npm http fetch GET 200 https://registry.npmjs.org/@pre-bundled/tape/-/tape-5.0.0.tgz 3ms (from cache) | |
| npm http fetch GET 200 https://registry.npmjs.org/@pre-bundled/tape/-/tape-5.0.0.tgz 59ms (from cache) | |
| npm notice | |
| npm notice 📦 @pre-bundled/[email protected] | |
| npm notice === Tarball Contents === | |
| npm notice 17B pre-bundled/node_modules/dotignore/test/.1-ignore | |
| npm notice 468B .editorconfig |
| 1 import fs, { readFileSync } from 'fs'; | |
| 2 import { syncBuiltinESMExports, createRequire } from 'module'; | |
| 3 | |
| 4 const require = createRequire(import.meta.url) | |
| 5 const { readFileSync: readFileSync2 } = require('fs') | |
| 6 | |
| 7 var ref = readFileSync | |
| 8 | |
| 9 console.log('import', readFileSync) | |
| 10 console.log('var ok ?', ref) |
| class DataTableExample extends DataTable { | |
| computeRowValues (row) { | |
| return [ | |
| row.message, | |
| new Date(row.timestamp).toGMTString() | |
| ] | |
| } | |
| computeRowHeaders () { |
| 'use strict' | |
| const pino = require('pino') | |
| const os = require('os') | |
| const { modes } = require('./logger.js') | |
| /** | |
| * This class gives an improved interface for pino | |
| * |