MCPcopy Index your code
hub / github.com/processing/p5.js / generateModuleBuild

Function generateModuleBuild

rollup.config.mjs:40–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38
39const modules = ['webgpu']; // TODO: also generate math build
40const generateModuleBuild = () => {
41 return modules.map(module => {
42 return {
43 input: `src/${module}/index.js`,
44 output: [
45 {
46 file: `./lib/p5.${module}.js`,
47 format: 'iife',
48 plugins: [
49 bundleSize(`p5.${module}.js`)
50 ]
51 },
52 {
53 file: `./lib/p5.${module}.min.js`,
54 format: 'iife',
55 sourcemap: 'hidden',
56 plugins: [
57 terser({
58 compress: {
59 global_defs: {
60 IS_MINIFIED: true
61 }
62 },
63 format: {
64 comments: false
65 }
66 }),
67 bundleSize(`p5.${module}.min.js`)
68 ]
69 },
70 {
71 file: `./lib/p5.${module}.esm.js`,
72 format: 'esm',
73 plugins: [
74 bundleSize(`p5.${module}.esm.js`)
75 ]
76 }
77 ],
78 external: ['../core/main'],
79 plugins: [
80 ...plugins
81 ]
82 };
83 });
84};
85
86rmSync('./dist', {
87 force: true,

Callers 1

rollup.config.mjsFile · 0.85

Calls 1

bundleSizeFunction · 0.85

Tested by

no test coverage detected