Skip to content

Instantly share code, notes, and snippets.

@miminari
Last active October 27, 2018 13:04
Show Gist options
  • Save miminari/5be5f3dcd00504dbb952d138cbfb3489 to your computer and use it in GitHub Desktop.
Save miminari/5be5f3dcd00504dbb952d138cbfb3489 to your computer and use it in GitHub Desktop.
npm-scripts template for wordpress theme
module.exports = {
"env": {
"browser": true,
"commonjs": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 5
},
"rules": {
"no-console":0,
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
};
{
"name": "2018myTemplate",
"version": "1.1.1",
"description": "sass compile, minmum etc.",
"scripts": {
"sass": "node-sass --output-style expanded --indent-width 4 scss/style.scss style.css",
"autoprefix": "npx postcss *.css --use autoprefixer -d ../ --no-map",
"svginline": "npx postcss *.css --use postcss-inline-svg -d ../ --no-map",
"build:css": "npm run sass && npx postcss *.css --use postcss-inline-svg autoprefixer -d ../ --no-map",
"minify:css": "node-sass ../style.css ../style.min.css --output-style compressed",
"watch:css": "nodemon -e scss -x \"npm run build:css\"",
"release:css": "npm run build:css && npm run minify:css",
"check:js": "eslint js/*.js --fix",
"watchify": "watchify js/*.js -o ../js/main.js -v",
"watch:js": "nodemon -e js -x \"npm run build:js\"",
"build:js": "npm run check:js & browserify js/*.js -o ../js/main.js",
"minify:js": "uglifyjs ../js/main.js --compress --mangle --output ../js/main.min.js",
"release:js": "npm run check:js && npm run build:js && npm run minify:js",
"build": "npm run build:css && npm run build:js",
"watch": "nodemon -e scss,js -x \"npm run build:css && npm run build:js\"",
"release": "npm run release:css && npm run release:js",
"reload": "browser-sync start --proxy 'local.blog'",
"rimraf": "rimraf svg/dist",
"imageminsvgo": "node svg/imagemin-svgo.js",
"prebuildsprite": "npm run imageminsvgo",
"buildsprite": "svgstore -o svg/dist/svgsprite.svg svg/dist/icons/**/*.svg --inline",
"embedsprite": "node svg/embed-sprite.js",
"svgsprite": "npm run rimraf && npm run buildsprite && npm run embedsprite"
},
"dependencies": {
"autoprefixer": "^9.3.1",
"browser-sync": "^2.24.4",
"browserify": "^16.2.0",
"cpx": "^1.5.0",
"eslint": "^5.6.0",
"postcss-cli": "^6.0.0",
"uglify-es": "^3.3.9",
"watchify": "^3.11.0"
},
"devDependencies": {
"ejs": "^2.6.1",
"eslint-config-vue": "^2.0.2",
"eslint-plugin-vue": "^5.0.0-beta.3",
"imagemin": "^6.0.0",
"imagemin-svgo": "^7.0.0",
"node-sass": "^4.9.0",
"nodemon": "^1.17.3",
"postcss-inline-svg": "^3.1.1",
"svgstore-cli": "^1.3.1"
},
"browserslist": [
"last 1 version",
"> 1% in JP"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment