Skip to content

Instantly share code, notes, and snippets.

@blazeyo
Last active October 19, 2018 21:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blazeyo/00bdebf35f51085f15642b960f7ebcaa to your computer and use it in GitHub Desktop.
Save blazeyo/00bdebf35f51085f15642b960f7ebcaa to your computer and use it in GitHub Desktop.
Package json for transpiling javascript. Put it in the root of you drupal composer project and run `yarn install`. `yarn watch:js-dev` will start the file watcher.
{
"name": "project-name",
"version": "1.0.0",
"license": "MIT",
"devDependencies": {
"babel-core": "6.24.1",
"babel-plugin-add-header-comment": "^1.0.3",
"babel-preset-env": "1.4.0",
"chalk": "^1.1.3",
"chokidar": "1.6.1",
"cross-env": "^4.0.0",
"eslint": "3.19.0",
"eslint-config-airbnb": "14.1.0",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "4.0.0",
"eslint-plugin-react": "6.10.3",
"glob": "7.1.1",
"minimist": "^1.2.0"
},
"scripts": {
"build:js": "node ./web/core/scripts/js/babel-es6-build.js",
"build:js-dev": "cross-env NODE_ENV=development node ./web/core/scripts/js/babel-es6-build.js",
"watch:js": "node ./web/core/scripts/js/babel-es6-watch.js",
"watch:js-dev": "cross-env NODE_ENV=development node ./web/core/scripts/js/babel-es6-watch.js"
},
"babel": {
"presets": [
[
"env",
{
"modules": false,
"targets": {
"browsers": [
"ie >= 9",
"edge >= 13",
"firefox >= 5",
"opera >= 12",
"safari >= 5",
"chrome >= 56"
]
}
}
]
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment