Skip to content

Instantly share code, notes, and snippets.

@SAMMY7th
Last active December 10, 2015 10:43
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 SAMMY7th/9bc7305a5bbd4b8258d5 to your computer and use it in GitHub Desktop.
Save SAMMY7th/9bc7305a5bbd4b8258d5 to your computer and use it in GitHub Desktop.
2015/09/26 いまどきのフロントエンド環境構築(関西フロントエンドUG) 発表用サンプル
PATH := node_modules/.bin:$(PATH)
all: build
.PHONY: all init build styles js html image clean
init:
npm init
npm install -D node-sass postcss-cli autoprefixer clean-css uglify-js
mkdir -p app/styles app/scripts app/images
touch app/index.html
build: clean styles js html image
styles:
node-sass app/styles -o .tmp/styles --output-style expanded
postcss --use autoprefixer .tmp/styles/*.css -d .tmp/styles
mkdir -p dist/styles
cat .tmp/styles/*.css | cleancss -o dist/styles/main.css
js: dist/scripts/main.js
dist/scripts/main.js: app/scripts/*.js
mkdir -p dist/scripts
uglifyjs app/scripts/*.js -o dist/scripts/main.js
html:
-cp app/*.html dist/
image:
mkdir -p dist/images
-cp -a app/images/ dist/images/
clean:
-rm -rf .tmp dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment