Skip to content

Instantly share code, notes, and snippets.

@othree
Last active December 17, 2018 13:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save othree/51096b82305dc5c9d920330fe7366a1b to your computer and use it in GitHub Desktop.
Save othree/51096b82305dc5c9d920330fe7366a1b to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var rollup = require('rollup').rollup;
var nodeResolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
var typescript = require('rollup-plugin-typescript');
var replace = require('rollup-plugin-replace');
gulp.task('default', ['bundle']);
gulp.task('bundle', function () {
return rollup({
entry: './src/scripts/index.tsx',
plugins: [
typescript({ jsx: 'react' }),
nodeResolve({ jsnext: true }),
commonjs({
include: 'node_modules/**',
namedExports: {
'react-dom': ['render']
}
}),
replace({
'process.env.NODE_ENV': JSON.stringify('production')
})
]
}).then(function (bundle) {
return bundle.write({
format: 'iife',
dest: './www/scripts/index.js'
});
});
});
@yairEO
Copy link

yairEO commented Dec 17, 2018

hallelujah! praise the lords of the internet! Someone with some sense finally. Enough of this Webpack bullshit, Gulp is so much superior!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment