Skip to content

Instantly share code, notes, and snippets.

@mamemomonga
Created March 12, 2020 04:11
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 mamemomonga/6847173a1175a959d28b0f3b22ff823c to your computer and use it in GitHub Desktop.
Save mamemomonga/6847173a1175a959d28b0f3b22ff823c to your computer and use it in GitHub Desktop.
gulpクイックスタート

nodeとyarnのクイックインストール

$ apt update && apt install -y curl sudo xz-utils
$ bash << 'EOS'
NODE_VERSION=12.16.1
curl -Lo /tmp/node.tar.xz https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz
curl -Lo /tmp/yarn.tar.gz https://yarnpkg.com/latest.tar.gz

mkdir /tmp/node
tar JxC /tmp/node --strip-components=1 -f /tmp/node.tar.xz
tar zxC /tmp/node --strip-components=1 -f /tmp/yarn.tar.gz

sudo mv /tmp/node /usr/local/

echo 'export PATH=/usr/local/node/bin:$PATH' >> ~/.bashrc
exec $SHELL

node -v
yarn -v
EOS

gulpクイックスタート

$ echo '{ "presets": ["@babel/preset-env"] }' > .babelrc

$ yarn add -D \
@babel/core \
@babel/preset-env \
@babel/register \
gulp \
gulp-babel

$ cat > gulpfile.babel.js << 'EOS'
import gulp  from 'gulp'
import log   from 'fancy-log'
import babel from 'gulp-babel'

gulp.task('default',(cb)=>{
	console.log("Hello World!");
	cb()
});
EOS

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