Refactor build routine and switch to airbnb style (#1703)

- Relocate webpack stuff to assets/build
- Switch all js to airbnb code style
- Update webpack to v2.0 (beta)
- Update all other dependencies
- Assets manifest uses relative path as key [1]
- Code should be compatible with Node 4.5.0
- All dependencies have been updated

[1]: Previously the assets manifest would use the basename of a file path as
its key when looking up a cachebusted file. This was to be consistent with
Sage 8. This change makes it so that the relative path is used instead.

To clarify, review the following example.

Before:
```
{
  "main.js": "scripts/main_5f4bfc9a9f82291c6dea.js",
  "main.css": "styles/main_5f4bfc9a9f82291c6dea.css",
  "customizer.js": "scripts/customizer_5f4bfc9a9f82291c6dea.js"
}
```

After:
```
{
  "scripts/main.js":"scripts/main_5f4bfc9a9f82291c6dea.js",
  "styles/main.css":"styles/main_5f4bfc9a9f82291c6dea.css",
  "scripts/customizer.js":"scripts/customizer_5f4bfc9a9f82291c6dea.js"
}
```
This commit is contained in:
QWp6t
2016-09-04 19:13:16 -07:00
committed by GitHub
parent a69d57c547
commit f6bdc7b48c
22 changed files with 426 additions and 351 deletions

View File

@@ -18,55 +18,63 @@
}
],
"scripts": {
"build:production": "webpack -p --progress --release",
"build": "webpack -d --progress",
"watch": "node watch.js --watch",
"lint": "eslint -c .eslintrc assets/scripts watch.js webpack.config.js"
"build": "webpack --progress --config assets/build/webpack.config.js",
"build:production": "npm run build -s -- -p",
"start": "npm run build -s -- --watch",
"clean": "node node_modules/rimraf/bin.js dist",
"lint": "node node_modules/eslint/bin/eslint.js assets/scripts assets/build",
"test": "npm run lint -s"
},
"engines": {
"node": ">=4"
"node": ">=5"
},
"devDependencies": {
"assets-webpack-plugin": "^3.4.0",
"autoprefixer": "^6.1.0",
"babel-cli": "^6.6.5",
"babel-core": "^6.7.4",
"babel-eslint": "^6.0.0",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.13.2",
"babel-register": "^6.5.2",
"babel-runtime": "^6.5.0",
"body-parser": "^1.14.1",
"browser-sync": "^2.11.2",
"clean-webpack-plugin": "^0.1.8",
"css-loader": "^0.23.1",
"cssnano": "^3.5.2",
"eslint": "^3.2.2",
"eslint-loader": "^1.3.0",
"eslint-plugin-react": "^6.0.0",
"extract-text-webpack-plugin": "^1.0.1",
"autoprefixer": "^6.4.0",
"babel-cli": "^6.14.0",
"babel-core": "^6.14.0",
"babel-eslint": "^6.1.2",
"babel-loader": "^6.2.5",
"babel-preset-es2015-webpack": "^6.4.3",
"babel-register": "^6.14.0",
"babel-runtime": "^6.11.6",
"body-parser": "^1.15.2",
"browser-sync": "^2.14.0",
"browser-sync-webpack-plugin": "^1.1.2",
"clean-webpack-plugin": "^0.1.10",
"css-loader": "^0.24.0",
"cssnano": "^3.7.4",
"eslint": "^3.4.0",
"eslint-config-airbnb": "^10.0.1",
"eslint-config-airbnb-es5": "^1.0.9",
"eslint-loader": "^1.5.0",
"eslint-plugin-import": "^1.14.0",
"eslint-plugin-jsx-a11y": "^2.2.0",
"eslint-plugin-react": "^6.2.0",
"extract-text-webpack-plugin": "^2.0.0-beta.3",
"file-loader": "^0.9.0",
"image-webpack-loader": "^2.0.0",
"imagemin-pngcrush": "^5.0.0",
"glob-all": "^3.1.0",
"imagemin-mozjpeg": "^6.0.0",
"imagemin-webpack-plugin": "^1.0.8",
"imports-loader": "^0.6.5",
"lodash": "^4.15.0",
"minimist": "^1.2.0",
"monkey-hot-loader": "0.0.3",
"node-sass": "^3.4.2",
"node-sass": "^3.8.0",
"optimize-css-assets-webpack-plugin": "^1.3.0",
"postcss": "^5.0.18",
"postcss-loader": "^0.9.1",
"qs": "^6.1.0",
"resolve-url-loader": "^1.4.3",
"postcss": "^5.1.2",
"postcss-loader": "^0.11.0",
"qs": "^6.2.1",
"resolve-url-loader": "^1.6.0",
"rimraf": "^2.5.4",
"sass-loader": "^4.0.0",
"style-loader": "^0.13.0",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webpack": "^1.12.14",
"webpack-dev-middleware": "^1.6",
"webpack-hot-middleware": "^2.10.0"
"webpack": "^2.1.0-beta.21"
},
"dependencies": {
"bootstrap": "github:twbs/bootstrap#v4-dev",
"font-awesome": "^4.6.3",
"jquery": "^1.12.4"
"jquery": "1.12.4 - 3"
}
}