How to use @ampproject/rollup-plugin-closure-compiler - 10 common examples

To help you get started, we’ve selected a few @ampproject/rollup-plugin-closure-compiler 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 DavidWells / analytics / packages / analytics-core / rollup.config.js View on Github external
})
      ],
    ]
  },

  // CommonJS (for Node) build.
  {
    input: 'index.js',
    external: externals,
    output: [
      { file: packageJSON.main, format: 'cjs' }
    ],
    plugins: [
      ...sharedPlugins,
      ...[
        isProduction && compiler(closureOptions),
        isProduction && uglify({
          compress: {
            // screw_ie8: true,
            warnings: false
          },
          output: {
            comments: false
          },
          sourceMap: false
        })
      ],
    ],
  },
  // ES module (for bundlers) build.
  {
    input: 'index.js',
github wasmerio / wasmer-js / packages / wasm-terminal / rollup.lib.js View on Github external
}),
  typescript(typescriptPluginOptions),
  resolve({
    preferBuiltins: true
  }),
  commonjs(),
  globals(),
  builtins(),
  json(),
  // Copy over some assets for running the wasm terminal
  copy({
    targets: [
      { src: "./node_modules/xterm/dist/xterm.css", dest: "dist/xterm/" }
    ]
  }),
  process.env.PROD ? compiler() : undefined,
  process.env.PROD ? bundleSize() : undefined
];

const unoptimizedPlugins = [
  replace(replaceInlineOptions),
  inlineUrlPlugin,
  ...plugins
];

const unoptimizedBundles = [
  {
    input: "./lib/index.ts",
    output: {
      file: "dist/unoptimized/wasm-terminal.esm.js",
      format: "esm",
      sourcemap: sourcemapOption
github distillpub / post--activation-atlas / rollup.config.js View on Github external
plugins: [
			// indexify({
			// 	input: "./src/index.html",
			// 	output: "./public/index.html"
			// }), 
			json(),
			svelte({
				dev: !production,
				extensions: [".html", ".svelte", ".svg"],
				css: css => {
					css.write('public/_generated/main.css');
				}
			}),
			resolve(),
			commonjs(),
			production && compiler()
		]
	},
	{
		input: "src/app.js",
		output: {
			file: production ? 'public/_generated/app.min.js' : 'public/_generated/app.js',
			format: 'iife',
			sourcemap: true,
		},
		context: "window",
		plugins: [
			json(),
			svelte({
				dev: !production,
				extensions: [".html", ".svelte", ".svg"],
				css: css => {
github DavidWells / analytics / packages / analytics-core / rollup.config.js View on Github external
BUILD_NODE: JSON.stringify(false),
        'process.env.NODE_ENV': isProduction ? "'production'" : "'development'",
        'process.env.VERSION': JSON.stringify(packageJSON.version)
      }),
      commonjs({
        include: 'node_modules/**',
        // ignore: [ 'conditional-runtime-dependency' ]
      }),
      nodeResolve({
        jsnext: true,
        browser: true,
        builtins: false,
        main: true,
      }),
      ...[
        isProduction && compiler({
          compilationLevel: 'SIMPLE',
          languageIn: 'ECMASCRIPT5_STRICT',
          languageOut: 'ECMASCRIPT5',
          env: 'CUSTOM',
          warningLevel: 'QUIET',
          applyInputSourceMaps: false,
          useTypesForOptimization: false,
          processCommonJsModules: false,
        }),
        isProduction && uglify({
          compress: {
            // screw_ie8: true,
            warnings: false
          },
          output: {
            comments: false
github popperjs / popper.js / .config / rollup.config.js View on Github external
inputs.map(input => ({
      input,
      plugins: [
        replace({
          __DEV__: minify ? 'false' : 'true',
        }),
        babel(),
        // The two minifiers together seem to procude a smaller bundle 🤷‍♂️
        minify && compiler(),
        minify && terser(),
        license({ banner: `@popperjs/core v${pkg.version}` }),
        flow && flowEntry(),
        bundleSize(),
        visualizer({
          sourcemap: true,
          filename: `stats/${getFileName(input)}${minify ? '-min' : ''}.html`,
        }),
      ].filter(Boolean),
      output: {
        name: 'Popper',
        file: `${dir}/${format}/${getFileName(input)}${
          minify ? '.min' : ''
        }.js`,
        format,
        sourcemap: true,
github DavidWells / analytics / packages / analytics-core / scripts / build / rollup.config.js View on Github external
},
      // Remove node builtins for browser. Might not need
      ...[
        config.browser && removeNodeBuiltIns(),
      ],
      replace({
        'process.browser': JSON.stringify(!!config.browser),
        'process.env.NODE_ENV': isProduction ? "'production'" : "'development'",
        'process.env.VERSION': JSON.stringify(pkg.version)
      }),
      commonjs({
        include: 'node_modules/**',
        // ignore: [ 'conditional-runtime-dependency' ]
      }),
      ...[
        doMinify && isProduction && !isESModule && compiler({
          compilationLevel: 'SIMPLE',
          languageIn: 'ECMASCRIPT5_STRICT',
          languageOut: (isIIFE) ? 'ECMASCRIPT5' : 'ECMASCRIPT5_STRICT',
          env: (isIIFE) ? 'BROWSER' : 'CUSTOM',
          warningLevel: 'QUIET',
          applyInputSourceMaps: false,
          useTypesForOptimization: false,
          processCommonJsModules: false,
        }),
        // Try all the shrinkers
        doMinify && isProduction && !isESModule && !isIIFE && terser(),
        doMinify && isProduction && !isESModule && !isIIFE && minify(),
        doMinify && isProduction && !isESModule && !isIIFE && uglify({
          compress: {
            // screw_ie8: true,
            warnings: false
github wasmerio / wasmer-js / packages / wasmfs / rollup.config.js View on Github external
let typescriptPluginOptions = {
  tsconfig: "../../tsconfig.json",
  exclude: ["./test/**/*"],
  clean: process.env.PROD ? true : false
};

let plugins = [
  typescript(typescriptPluginOptions),
  resolve({
    preferBuiltins: true
  }),
  commonjs(),
  globals(),
  builtins(),
  json(),
  process.env.PROD ? compiler() : undefined,
  process.env.PROD ? bundleSize() : undefined
];

const fileSystemBundles = [
  {
    input: "src/index.ts",
    output: [
      {
        file: pkg.main,
        format: "cjs",
        sourcemap: sourcemapOption
      },
      {
        file: pkg.module,
        format: "esm",
        sourcemap: sourcemapOption
github wasmerio / wasmer-js / packages / wasm-terminal / rollup.worker.js View on Github external
entries: [
      {
        find: "comlink",
        replacement: `${__dirname}/node_modules/comlink/src/comlink`
      }
    ]
  }),
  typescript(typescriptPluginOptions),
  resolve({
    preferBuiltins: true
  }),
  commonjs(),
  globals(),
  builtins(),
  json(),
  process.env.PROD ? compiler() : undefined,
  process.env.PROD ? bundleSize() : undefined
];

const workerBundles = [
  {
    input: "./src/workers/process.worker.ts",
    output: [
      {
        file: "lib/workers/process.worker.js",
        format: "iife",
        sourcemap: sourcemapOption,
        name: "Process"
      }
    ],
    watch: {
      clearScreen: false
github wasmerio / wasmer-js / packages / io-devices / rollup.config.js View on Github external
let typescriptPluginOptions = {
  tsconfig: "../../tsconfig.json",
  exclude: ["./test/**/*"],
  clean: process.env.PROD ? true : false
};

let plugins = [
  typescript(typescriptPluginOptions),
  resolve({
    preferBuiltins: true
  }),
  commonjs(),
  globals(),
  builtins(),
  json(),
  process.env.PROD ? compiler() : undefined,
  process.env.PROD ? bundleSize() : undefined
];

const fileSystemBundles = [
  {
    input: "src/index.ts",
    output: [
      {
        file: pkg.main,
        format: "cjs",
        sourcemap: sourcemapOption
      },
      {
        file: pkg.module,
        format: "esm",
        sourcemap: sourcemapOption
github wasmerio / wasmer-js / packages / wasi / rollup.config.js View on Github external
let typescriptPluginOptions = {
  tsconfig: "../../tsconfig.json",
  exclude: ["./test/**/*"],
  clean: process.env.PROD ? true : false,
  objectHashIgnoreUnknownHack: true
};

const plugins = [
  typescript(typescriptPluginOptions),
  resolve({ preferBuiltins: true }),
  commonjs(),
  globals(),
  builtins(),
  json(),
  process.env.PROD ? compiler() : undefined,
  process.env.PROD ? bundleSize() : undefined
];

const libBundles = [
  {
    input: "./src/index.ts",
    output: {
      file: pkg.module,
      format: "esm",
      sourcemap: sourcemapOption
    },
    watch: {
      clearScreen: false
    },
    plugins: [replace(replaceBrowserOptions), ...plugins]
  },

@ampproject/rollup-plugin-closure-compiler

Rollup + Google Closure Compiler

Apache-2.0
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis

Popular @ampproject/rollup-plugin-closure-compiler functions