Skip to content

Instantly share code, notes, and snippets.

@vnys
Created September 22, 2015 11:36
Show Gist options
  • Save vnys/5316d2221d5f608a0417 to your computer and use it in GitHub Desktop.
Save vnys/5316d2221d5f608a0417 to your computer and use it in GitHub Desktop.
npm scripts for bundling and transpiling es6 modules, with babel, rollup and postcss
{
"author": "Victor Nystad",
"scripts": {
"postinstall": "./node_modules/bower/bin/bower install && npm start",
"start": "npm run watch:js & npm run watch:css & npm run serve",
"preserve": "npm run build:js & npm run build:css",
"serve": "browser-sync start --server www --server dist --server bower_components --files 'dist/*, www/*'",
"watch:js" : "chokidar 'index.js' -c 'npm run build:js'",
"watch:css" : "chokidar 'css/*.css' -c 'npm run build:css'",
"build:js": "mkdir -p dist && rollup index.js | babel -m umd --module-id fotballdataElements -o dist/test.js",
"build:css": "postcss -u autoprefixer --autoprefixer.browsers 'last 2 versions' -u postcss-import -o dist/test.css css/index.css"
},
"devDependencies": {
"autoprefixer": "^6.0.3",
"babel": "^5.8.23",
"bower": "^1.5.2",
"browser-sync": "^2.9.3",
"chokidar-cli": "^1.0.1",
"postcss-cli": "^2.1.0",
"postcss-import": "^7.0.0",
"rollup": "^0.16.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment