Last active
December 17, 2018 13:35
-
-
Save othree/51096b82305dc5c9d920330fe7366a1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hallelujah! praise the lords of the internet! Someone with some sense finally. Enough of this Webpack bullshit, Gulp is so much superior!