Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@yairEO 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
You can’t perform that action at this time.