How to use rollup-plugin-filesize - 10 common examples

To help you get started, we’ve selected a few rollup-plugin-filesize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SimonDEvans / takt / rollup.config.js View on Github external
resolve({
            jsnext: true,
            main: true,
            browser: true,
        }),
        commonjs(),
        babel(),
    ]
};

// Add Production or Development settings to the config object
if(process.env.production){
    config.sourceMap = false;
    config.plugins.push(uglify());
    config.plugins.push(sizes());
    config.plugins.push(filesize());
} else {
    config.sourceMap = true;
}

export default config;
github Esri / solution.js / umd-production-profile.js View on Github external
import config from './umd-base-profile.js';
import { terser } from "rollup-plugin-terser";
import filesize from "rollup-plugin-filesize";

// use umd.min.js
config.output.file = config.output.file.replace(".umd.", ".umd.min.");

config.plugins.push(filesize())
config.plugins.push(terser({
  output: { comments: /@preserve/ }
}))

export default config;
github joe-sky / nornj / packages / nornj-react / rollup.config.js View on Github external
}

  if (env === 'production') {
    config.plugins.push(
      uglify({
        compress: {
          pure_getters: true, // eslint-disable-line
          unsafe: true,
          unsafe_comps: true // eslint-disable-line
        },
        warnings: false
      })
    );
  }

  config.plugins.push(filesize());
} else {
  config = {
    input: './src/base.ts',
    output: { format: 'es' },
    plugins: [dts()]
  };
}

config.plugins.push(
  license({
    banner: `/*!
 * NornJ-React${withEx ? '-' + withEx : ''} v${require('../../package.json').version}
 * (c) 2016-2019 Joe_Sky
 * Released under the MIT License.
 */`
  })
github stampit-org / stampit / build / index.js View on Github external
const inputConfig = {
    entry: `src/${config.moduleName}.js`,
    plugins: [
      buble(),
    ]
  };

  if (isUMD) {
    inputConfig.plugins.push(removeEsModuleFreeze());
  } else {
    inputConfig.external = Object.keys(pkg.dependencies);
  }

  if (config.minify) {
    inputConfig.plugins.push(uglify());
    inputConfig.plugins.push(filesize({
      format: {exponent: 0},
      render: (opt, size, gzip) => `Estimating ${outputConfig.dest}: ${size}, GZIP : ${gzip}`
    }));
  }

  return rollup(inputConfig)
    .then(bundle => bundle.write(outputConfig))
    .then(() => console.log('created', outputConfig.dest));
}
github microfeedback / microfeedback-button / rollup.config.js View on Github external
babel({
      exclude: ['**/*.json'],
    }),
    json()
  );
}

if (env === 'production') {
  config.plugins.push(uglify());
}

if (process.env.SERVE === 'true') {
  config.plugins.push(serve({contentBase: ['dist', 'examples'], open: true}));
}

config.plugins.push(filesize());
export default config;
github Aidurber / react-picky / rollup.config.js View on Github external
file: 'dist/index.js',
    format: 'cjs',
  },
  external: ['react', 'prop-types', 'react-dom', 'lodash.isequal'],
  plugins: [
    css({ output: 'dist/picky.css' }),
    resolve(),
    babel({
      exclude: 'node_modules/**',
      externalHelpers: true,
    }),
    commonjs({
      ignore: ['node_modules/prop-types'],
    }),
    isProduction && uglify(),
    isProduction && filesize(),
  ],
};
github motss / lit-ntml / rollup.config.js View on Github external
...('umd' === format ? { tsconfigOverride: { compilerOptions: { target: 'es5' } } } : {}),
    }),
    isProd && minify && terser({
      compress: true,
      mangle: {
        module: 'esm' === format,
        properties: { regex: /^_/ },
        reserved: [],
        safari10: true,
        toplevel: true,
      },
      output: { safari10: true },
      safari10: true,
      toplevel: true,
    }),
    isProd && filesize({ showBrotliSize: true }),
  ];
};
github inlet / react-pixi / rollup.config.js View on Github external
commonjs({
        ignoreGlobal: false,
        namedExports: {
          'node_modules/scheduler/index.js': [
            'unstable_scheduleCallback',
            'unstable_cancelCallback'
          ]
        }
      }),
      replace({
        __DEV__: prod ? 'false' : 'true',
        'process.env.NODE_ENV': prod ? '"production"' : '"development"',
      }),
      globals(),
      prod && terser(),
      filesize(),
    ].filter(Boolean),
    external: [
      'pixi.js',
      'react',
      'react-dom'
    ]
  }
}
github diegomura / react-portalgun / rollup.config.js View on Github external
plugins: [
      resolve(),
      replace({
        exclude: 'node_modules/**',
        'process.env.NODE_ENV': JSON.stringify(
          process.env.NODE_ENV || 'development'
        ),
      }),
      commonjs({
        include: /node_modules/,
        namedExports: {
          'node_modules/prop-types/index.js': ['func'],
        },
      }),
      sourceMaps(),
      process.env.NODE_ENV === 'production' && filesize(),
      process.env.NODE_ENV === 'production' && (
        uglify({}, minify)
      )
    ]
  }),

  Object.assign({}, shared, {
    output: [
      {
        file: 'dist/react-portalgun.es6.js',
        format: 'es',
        sourcemap: true,
        exports: 'named',
        globals: { react: 'React' }
      },
      {
github mweststrate / rval / rollup.config.js View on Github external
{
                        warnings: true,
                        compress: true,
                        mangle: {
                            properties: {
                                keep_quoted: true,
                                reserved
                            },
                            reserved
                        },
                        module: true,
                        toplevel: true,
                        sourcemap: true,
                    }
                ),
            filesize()
        ].filter(Boolean)
    }

    return conf
}

rollup-plugin-filesize

A rollup plugin to show filesize in the cli

MIT
Latest version published 2 years ago

Package Health Score

47 / 100
Full package analysis

Popular rollup-plugin-filesize functions