Skip to content

Instantly share code, notes, and snippets.

@volkanunsal
Created December 22, 2020 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save volkanunsal/384bd724f0e5d11bf0c47e4b89e2679f to your computer and use it in GitHub Desktop.
Save volkanunsal/384bd724f0e5d11bf0c47e4b89e2679f to your computer and use it in GitHub Desktop.
const typescript = require('@rollup/plugin-typescript');
const { nodeResolve } = require('@rollup/plugin-node-resolve');
const commonjs = require('@rollup/plugin-commonjs');
const json = require('@rollup/plugin-json');
const serve = require('rollup-plugin-serve');
const livereload = require('rollup-plugin-livereload');
const replace = require('@rollup/plugin-replace');
module.exports = {
input: 'src/index.tsx',
output: {
file: 'public/bundle.js',
format: 'es',
},
watch: {
skipWrite: false,
clearScreen: false,
include: 'src/**/*',
},
plugins: [
serve('public'),
livereload({
watch: 'public',
}),
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
nodeResolve(),
typescript(),
json(),
commonjs(),
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment