I have gone in the problem where i have found a lot of unused bundled code (lodash) and found easy way to solve that.
As in Screeps the lodash module is included by default, i think it should not be bundled one more time. So changing:
// rollup.config.js
export default {
input: "src/main.ts",
output: {
file: "dist/main.js",
format: "cjs",
sourcemap: true
},
plugins: [
clear({ targets: ["dist"] }),
resolve(),
commonjs(),
typescript({tsconfig: "./tsconfig.json"}),
screeps({config: cfg, dryRun: cfg == null})
]
}
// UPDATE TO
// rollup.config.js
export default {
input: "src/main.ts",
output: {
file: "dist/main.js",
format: "cjs",
sourcemap: true
},
external: ['lodash'],
plugins: [
clear({ targets: ["dist"] }),
resolve(),
commonjs(),
typescript({tsconfig: "./tsconfig.json"}),
screeps({config: cfg, dryRun: cfg == null})
]
}
... would save a lot of code bundled and improve smart bundling effect.
However, there might be an issue with incompatible lodash version so it is still only an option.
I have gone in the problem where i have found a lot of unused bundled code (lodash) and found easy way to solve that.
As in Screeps the lodash module is included by default, i think it should not be bundled one more time. So changing:
... would save a lot of code bundled and improve smart bundling effect.
However, there might be an issue with incompatible lodash version so it is still only an option.