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

rollup-plugin-terser minifying #116

Open
stygmate opened this issue Nov 11, 2019 · 2 comments
Open

rollup-plugin-terser minifying #116

stygmate opened this issue Nov 11, 2019 · 2 comments

Comments

@stygmate
Copy link

Hi,

Can anybody help me with adding terser to the rollup plugins for minifying ?

@pyrodogg
Copy link
Member

It works for me pretty much out of the box on a quick test.

  1. Install the rollup plugin as a development dependency
npm install -D rollup-plugin-terser
  1. Import plugin in rollup.config.js
import { terser } from "rollup-plugin-terser";
  1. Add plugin between Typescript compilation and the Screeps (uploader) in the plugins array.
  plugins: [
    clear({ targets: ["dist"] }),
    resolve(),
    commonjs(),
    typescript({tsconfig: "./tsconfig.json"}),
    terser(),
    screeps({config: cfg, dryRun: cfg == null})
  ]

This should run the compiled bundle of Javascript through terser before uploading to Screeps. If you have more questions about terser options you're better off checking with the plugin author.

@ttxs25830
Copy link

It works for me pretty much out of the box on a quick test.

  1. Install the rollup plugin as a development dependency
npm install -D rollup-plugin-terser
  1. Import plugin in rollup.config.js
import { terser } from "rollup-plugin-terser";
  1. Add plugin between Typescript compilation and the Screeps (uploader) in the plugins array.
  plugins: [
    clear({ targets: ["dist"] }),
    resolve(),
    commonjs(),
    typescript({tsconfig: "./tsconfig.json"}),
    terser(),
    screeps({config: cfg, dryRun: cfg == null})
  ]

This should run the compiled bundle of Javascript through terser before uploading to Screeps. If you have more questions about terser options you're better off checking with the plugin author.

Can I use "cleanup" plugin with terser? I see a lots of people doing that. If yes, who shoud come first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants