Skip to content

Instantly share code, notes, and snippets.

@kejun
Last active April 1, 2018 00:14
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 kejun/583a3be87ec84a25e26adac1d4de1b85 to your computer and use it in GitHub Desktop.
Save kejun/583a3be87ec84a25e26adac1d4de1b85 to your computer and use it in GitHub Desktop.
package.json
{
"devDependencies": {
"autoprefixer": "^7.2.5",
"babel-preset-env": "^1.6.1",
"node-sass": "^4.7.2",
"postcss-inline-svg": "^3.0.0",
"postcss-write-svg": "^3.0.1"
},
"dependencies": {
"core-js": "^2.5.3"
}
}
.postcssrc
{
"plugins": {
"autoprefixer": true,
"postcss-inline-svg": true,
"postcss-write-svg": true
}
}
.sassrc
{
"includePaths": ["node_modules"]
}
.browserslistrc
> 1%
last 4 versions
IE 9
.babelrc
{
"presets": ["env"]
}
.gitignore
*.sw*
!*.swf
*.bak
*.log
*.tmp
.cache
.DS_Store
._.DS_Store
node_modules
.bash_profile:
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export PS1="\n \W: "
alias gitlog="git log --pretty=oneline --graph"
alias weather="curl -4 http://wttr.in"
Makefile:
STATIC_DIR = ../../
APP_NAME = note_editor
deploy: clean build build_detect gen_css copy
install:
yarn install
dev:
npm run build-watch
build:
npm run build
build_detect:
./node_modules/.bin/babel node_modules/editor-compatibility/detect.js --out-file ./dist/js/detect_browser.js
gen_css:
./node_modules/node-sass/bin/node-sass ./node_modules/editor-compatibility/css/index.scss > $(STATIC_DIR)css/note/note_compatibility.css
update:
npm i --save git+https://github.intra.douban.com/kejun/editor.git
clean:
if [ -a dist ]; then rm -rf dist; fi;
if [ -a $(STATIC_DIR)js/note/ng/$(APP_NAME).js ]; then rm -rf $(STATIC_DIR)js/note/ng; fi;
if [ -a $(STATIC_DIR)css/note/ng/$(APP_NAME).css ]; then rm -rf $(STATIC_DIR)css/note/ng; fi;
copy_main:
mkdir -p $(STATIC_DIR)js/note/ng
mkdir -p $(STATIC_DIR)css/note/ng
cp ./dist/js/$(APP_NAME).js $(STATIC_DIR)js/note/ng/$(APP_NAME).js
cp ./dist/css/$(APP_NAME).css $(STATIC_DIR)css/note/ng/$(APP_NAME).css
copy_assets:
cp -r ./node_modules/rich-content-style/editor_icons $(STATIC_DIR)pics/note/
copy:
mkdir -p $(STATIC_DIR)js/note/ng
mkdir -p $(STATIC_DIR)css/note/ng
cp ./dist/js/html5_video.js $(STATIC_DIR)js/note/ng/html5_video.js
cp ./dist/css/html5_video.css $(STATIC_DIR)css/note/ng/html5_video.scss
cp ./node_modules/draft-js/dist/Draft.min.js $(STATIC_DIR)js/lib/draft.min.js
cp ./node_modules/editor-compatibility/pics/*.png $(STATIC_DIR)pics/note/
cp ./dist/js/detect_browser.js $(STATIC_DIR)js/note/ng/detect_browser.js
cp ./dist/js/$(APP_NAME).js $(STATIC_DIR)js/note/ng/$(APP_NAME).js
cp ./dist/css/$(APP_NAME).css $(STATIC_DIR)css/note/ng/$(APP_NAME).css
cp ./dist/js/setting_standalone.js $(STATIC_DIR)js/note/ng/setting_standalone.js
cp ./dist/css/setting_standalone.css $(STATIC_DIR)css/note/ng/setting_standalone.css
cp -r ./node_modules/rich-content-style/editor_icons $(STATIC_DIR)pics/note/
cp ./dist/js/render_gif.js $(STATIC_DIR)js/note/ng/render_gif.js
cp ./dist/css/render_gif.css $(STATIC_DIR)css/note/ng/render_gif.css
cp ./node_modules/render-gif/example/pics/* $(STATIC_DIR)pics/note/gif/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment