-
-
Save ds0nt/e23b8e181ea1fa5751d3 to your computer and use it in GitHub Desktop.
[dsont@dsont-pc client]$ tree -I node_modules\|components | |
. | |
├── app.css | |
├── app.js | |
├── build | |
│ ├── app.css | |
│ ├── app.js | |
│ ├── browser-polyfill.js | |
│ └── index.html | |
├── config | |
│ └── components.yaml | |
├── elements | |
│ ├── apps.js | |
│ ├── layout.js | |
│ ├── login.js | |
│ ├── styles | |
│ │ ├── layout.css | |
│ │ ├── paint.css | |
│ │ └── typography.css | |
│ └── templates | |
│ ├── apps.hbs | |
│ ├── layout.hbs | |
│ └── login.hbs | |
├── lib | |
│ ├── api.js | |
│ ├── element.js | |
│ ├── plugins.js | |
│ ├── state.js | |
│ └── transforms.js | |
├── Makefile | |
├── package.json | |
├── public | |
│ └── index.html | |
└── README.md |
# | |
# Environment. | |
# | |
NODE := iojs | |
NODE_ENV ?= development | |
# | |
# Duo | |
# | |
DUO := duo | |
DUO_FLAGS := --use ./lib/plugins.js | |
ifeq ($(NODE_ENV),development) | |
DUO_FLAGS += --development | |
else | |
DUO_FLAGS += --external-source-maps | |
endif | |
# | |
# Wildcards. (Not so wild) | |
# | |
JS := $(wildcard app.js) | |
CSS := $(wildcard app.css) | |
PUBLIC := $(wildcard public/*) | |
PUBLIC_BUILD := $(patsubst public/%, %,$(wildcard public/*)) | |
POLYFILL := node_modules/duo-babel/node_modules/babel-core/browser-polyfill.js | |
# JS += $(shell find ../ -path '*/client/index.js') | |
# CSS := $(shell find -path 'index.css') | |
# PUBLIC := $(shell find -path 'public/*') | |
# | |
# Build. | |
# | |
build: node_modules polyfill $(addprefix build/, $(PUBLIC_BUILD) $(CSS) $(JS)) | |
@[ -d build ] || mkdir build | |
.PHONY: build | |
# | |
# Target for `build/*.js` files. | |
# | |
build/%.js: %.js | |
$(DUO) $(DUO_FLAGS) $< | |
# | |
# Target for `build/*.css` files. | |
# | |
build/%.css: %.css | |
(DUO) $(DUO_FLAGS) $< | |
build/%: $(PUBLIC) | |
cp $< $@ | |
polyfill: node_modules | |
@[ -f build/browser-polyfill ] || cp $(POLYFILL) build | |
# | |
# Target for `node_modules` folder. | |
# | |
node_modules: package.json | |
npm install | |
# | |
# Clean. | |
# | |
clean: clean-build | |
.PHONY: clean | |
# | |
# Clean generated build. | |
# | |
clean-build: | |
@rm -rf build | |
@$(DUO) clean-cache --quiet | |
.PHONY: clean-build | |
# | |
# Clean downloaded dependencies | |
# | |
clean-deps: | |
@rm -rf node_modules components | |
@npm cache clean | |
.PHONY: clean-deps |
Environment.
NODE := iojs
NODE_ENV ?= development
Duo
DUO := duo
DUO_FLAGS := --use ./lib/plugins.js
ifeq ($(NODE_ENV),development)
DUO_FLAGS += --development
else
DUO_FLAGS += --external-source-maps
endif
Wildcards. (Not so wild)
JS := $(wildcard app.js)
CSS := $(wildcard app.css)
PUBLIC := $(wildcard public/)
PUBLIC_TARGET := $(patsubst public/%, %, $(wildcard public/))
POLYFILL := node_modules/duo-babel/node_modules/babel-core/browser-polyfill.js
POLYFILL_TARGET := browser-polyfill.js
JS += $(shell find ../ -path '*/client/index.js')
CSS := $(shell find -path 'index.css')
PUBLIC := $(shell find -path 'public/*')
Build.
build: node_modules
.PHONY: build
build/%:
@[ -d build ] || mkdir build
@cp $^ build
Target for build/*.js
files.
build/%.js: %.js
Target for build/*.css
files.
build/%.css: %.css
Target for node_modules
folder.
node_modules: package.json
npm install
Clean.
clean: clean-build
.PHONY: clean
Clean generated build.
clean-build:
@rm -rf build
@$(DUO) clean-cache --quiet
.PHONY: clean-build
Clean downloaded dependencies
clean-deps:
@rm -rf node_modules components
@npm cache clean
.PHONY: clean-deps
The makefile makes the site?