/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// We need to handle workers 1 by 1 to be able to generate umd bundles. const entries = { "parser-worker": getEntry("src/workers/parser/worker.js"), "pretty-print-worker": getEntry("src/workers/pretty-print/worker.js"), "search-worker": getEntry("src/workers/search/worker.js"),
};
for (const [entryName, input] of Object.entries(entries)) {
let bundle; try { // create a bundle
bundle = await rollup({
input: {
[entryName]: input,
},
plugins: [
commonjs({
transformMixedEsModules: true,
strictRequires: true,
}),
injectProcessEnv({ NODE_ENV: "production" }),
nodeResolve(), // read-wasm.js is part of source-map and is only for Node environment. // we need to ignore it, otherwise __dirname is inlined with the path the bundle // is generated from, which makes the verify-bundle task fail
nodePolyfills({ exclude: [/read-wasm\.js/] }),
],
});
await bundle.write({
dir: bundlePath,
entryFileNames: "[name].js",
format: "umd",
});
} catch (error) {
success = false; // do some error reporting
console.error("[bundle|rollup] Something went wrong.", error);
} if (bundle) { // closes the bundle
await bundle.close();
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.