How to use rollup-plugin-size-snapshot - 10 common examples

To help you get started, we’ve selected a few rollup-plugin-size-snapshot 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 piotrwitek / typesafe-actions / rollup.config.js View on Github external
plugins: [
      nodeResolve({
        mainFields: ['module', 'jsnext', 'main'],
        browser: format !== 'cjs',
      }),
      format === 'umd' &&
        commonjs({
          include: /\/node_modules\//,
        }),
      json(),
      babel(babelOptions(format)),
      replace({
        'process.env.NODE_ENV': JSON.stringify(env),
      }),
      sourceMaps(),
      sizeSnapshot({
        printInfo: false,
      }),
      env === 'production' &&
        terser({
          sourcemap: true,
          output: { comments: false },
          compress: {
            keep_infinity: true,
            pure_getters: true,
            // collapse_vars: false,
          },
          ecma: 5,
          toplevel: format === 'es' || format === 'cjs',
          warnings: true,
        }),
    ],
github zerobias / effector / tools / builder.js View on Github external
const getPlugins = () => ({
  babel: babel({// runtimeHelpers: true,
    // exclude: /(\.re|node_modules.*)/,
  }),
  replace: replace({
    'process.env.NODE_ENV': JSON.stringify('production')
  }),
  commonjs: commonjs({}),
  resolve: resolve({}),
  terser: rollupPluginTerser.terser(minifyConfig({
    prettify: !!process.env.PRETTIFY
  })),
  sizeSnapshot: rollupPluginSizeSnapshot.sizeSnapshot(),
  graph: plugin({
    output: 'modules.dot'
  })
});
github zhw2590582 / ArtPlayer / scripts / creatRollupConfig.js View on Github external
commonjs(),
            babel({
                runtimeHelpers: true,
                exclude: ['node_modules/**', 'packages/**/node_modules/**'],
                presets: [['@babel/env', { modules: false }]],
                plugins: ['@babel/plugin-external-helpers', '@babel/plugin-transform-runtime'],
            }),
            svgo({
                raw: true,
            }),
            replace({
                exclude: 'node_modules/**',
                __ENV__: JSON.stringify(process.env.NODE_ENV || 'development'),
                __VERSION__: version,
            }),
            isProd && sizeSnapshot(),
            isProd && removeHtmlSpace(),
            isProd &&
                terser({
                    output: {
                        preamble: banner,
                        comments: function() {
                            return false;
                        },
                    },
                }),
            isProd &&
                copyAfterBuild({
                    from: path.join(projectPath, 'dist/*'),
                    to: path.join(process.cwd(), 'dist'),
                }),
        ],
github drcmda / react-animated-tree / rollup.config.js View on Github external
function createConfig(entry, out, name) {
  return [
    {
      input: `./src/${entry}.js`,
      output: { file: `dist/${out}.es.js`, format: 'es' },
      external: isExternal,
      plugins: [babel(getBabelOptions({ useESModules: true })), sizeSnapshot()],
    },
    {
      input: `./src/${entry}.js`,
      output: { file: `dist/${out}.cjs.js`, format: 'cjs' },
      external: isExternal,
      plugins: [babel(getBabelOptions({ useESModules: false }))],
    },
    {
      input: `./src/${entry}.js`,
      output: {
        file: `dist/${out}.umd.js`,
        format: 'umd',
        name,
        globals: {
          react: 'React',
          'react-dom': 'ReactDOM',
github react-spring / react-three-fiber / rollup.config.js View on Github external
function createConfig(entry, out) {
  return [
    {
      input: `./src/${entry}`,
      output: { file: `dist/${out}.js`, format: 'esm' },
      external,
      plugins: [
        json(),
        babel(getBabelOptions({ useESModules: true }, '>1%, not dead, not ie 11, not op_mini all')),
        sizeSnapshot(),
        resolve({ extensions }),
      ],
    },
    {
      input: `./src/${entry}`,
      output: { file: `dist/${out}.cjs.js`, format: 'cjs' },
      external,
      plugins: [json(), babel(getBabelOptions({ useESModules: false })), sizeSnapshot(), resolve({ extensions })],
    },
  ]
}
github react-spring / react-spring / rollup.config.js View on Github external
function createConfig(entry, out) {
  return [
    {
      input: `./src/${entry}/index`,
      output: { file: `dist/${out}.js`, format: 'esm' },
      external,
      plugins: [
        babel(
          getBabelOptions(
            { useESModules: true },
            '>1%, not dead, not ie 11, not op_mini all'
          )
        ),
        sizeSnapshot(),
        resolve({ extensions }),
      ],
    },
    {
      input: `./src/${entry}/index`,
      output: { file: `dist/${out}.cjs.js`, format: 'cjs' },
      external,
      plugins: [
        babel(getBabelOptions({ useESModules: false })),
        sizeSnapshot(),
        resolve({ extensions }),
      ],
    },
  ]
}
github zerobias / effector / tools / builder / rollup.js View on Github external
const getPlugins = (name: string) => ({
  babel: babel({
    runtimeHelpers: false,
    exclude: /(\.re|node_modules.*)/,
  }),
  replace: replace({
    'process.env.NODE_ENV': JSON.stringify('production'),
  }),
  commonjs: commonjs({}),
  resolve: resolve({}),
  sizeSnapshot: sizeSnapshot({
    printInfo: false,
  }),
  analyzer: analyze({
    filename: `stats/${name}.html`,
    title: `${name} size report`,
    sourcemap: true,
    template: 'treemap',
  }),
  analyzerJSON: analyze({
    sourcemap: true,
    json: true,
    filename: `stats/${name}.json`,
  }),
  terser: terser(
    minifyConfig({
      beautify: !!process.env.PRETTIFY,
github pshrmn / curi / utils / rollup-plugins.js View on Github external
const typescript = require("rollup-plugin-typescript2");

exports.replaceWithProduction = replace({
  "process.env.NODE_ENV": `"production"`
});
exports.replaceWithDevelopment = replace({
  "process.env.NODE_ENV": `"development"`
});

exports.resolveNode = resolve();

exports.commonjs = commonjs({
  include: /node_modules/
});

exports.sizeSnapshot = sizeSnapshot();

exports.minify = uglify();

exports.typescript = typescript({
  useTsconfigDeclarationDir: true
});
github pshrmn / hickory / rollup / plugins.js View on Github external
exports.replaceWithProduction = replace({
  "process.env.NODE_ENV": `"production"`
});

exports.replaceWithDevelopment = replace({
  "process.env.NODE_ENV": `"development"`
});

exports.resolveNode = resolve();

exports.commonjs = commonjs({
  include: /node_modules/
});

exports.sizeSnapshot = sizeSnapshot();

exports.minify = uglify();

exports.typescript = typescript({
  useTsconfigDeclarationDir: true
});
github jaredpalmer / tsdx / index.js View on Github external
declaration: true,
            jsx: 'react',
          },
        },
        tsconfigOverride: {
          compilerOptions: {
            target: 'esnext',
          },
        },
      }),
      babel(babelOptions),
      replace({
        'process.env.NODE_ENV': JSON.stringify(env),
      }),
      sourceMaps(),
      sizeSnapshot(),
      env === 'production' &&
        terser({
          sourcemap: true,
          output: { comments: false },
          compress: {
            keep_infinity: true,
            pure_getters: true,
          },
          ecma: 5,
          toplevel: format === 'es' || format === 'cjs',
          warnings: true,
        }),
    ],
  };
}

rollup-plugin-size-snapshot

[travis-img]: https://travis-ci.org/TrySound/rollup-plugin-size-snapshot.svg [travis]: https://travis-ci.org/TrySound/rollup-plugin-size-snapshot

MIT
Latest version published 4 years ago

Package Health Score

42 / 100
Full package analysis

Popular rollup-plugin-size-snapshot functions