Skip to content

Commit

Permalink
housekeeping: webpack@4 + babel@7 (via #2020)
Browse files Browse the repository at this point in the history
* babel@7

* structure styles within LESS entrypoint

...instead of importing them among JS modules

* use ESM syntax for entrypoint exports

...because webpack@4 doesn't tolerate import syntax + CJS export syntax

* use property access instead of destructuring `process.env` usage

...because webpack@4 doesn't rewrite destructured access

* webpack@4

* base config builder

* asset build configurations

* dev server configuration

* size audit configuration

* remove legacy validation worker assets

* skip needless minification in `deps-size`

* update package scripts

* remove legacy configs

* prettier

* remove unused Babel plugins

* use correct jsx loader in Mocha

* update eslint

* eslint fixes
  • Loading branch information
shockey authored Jul 24, 2019
1 parent 0e28b8f commit c60ee58
Show file tree
Hide file tree
Showing 37 changed files with 10,835 additions and 7,411 deletions.
54 changes: 37 additions & 17 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,29 +1,49 @@
{
"presets": [
"es2015",
"react",
"stage-0"
[
"@babel/env",
{
"targets": {
"browsers": [
/* benefit of C/S/FF/Edge only? */
"> 1%",
"last 2 versions",
"Firefox ESR",
"not dead",
]
},
"useBuiltIns": "entry",
"corejs": "2"
}
],
"@babel/preset-react"
],
"plugins": [
"transform-runtime",
"transform-async-to-generator",
"transform-es2015-constants",
[
"module-alias",
[
"@babel/plugin-transform-runtime",
{
"expose": "plugins",
"src": "src/plugins"
},
"corejs": "2"
}
],
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-optional-chaining",
[
"transform-react-remove-prop-types",
{
"expose": "test",
"src": "test"
},
"additionalLibraries": [
"react-immutable-proptypes"
]
}
],
[
"babel-plugin-module-resolver",
{
"expose": "src",
"src": "src"
"alias": {
"plugins": "./src/plugins",
"test": "./test",
"src": "./src"
}
}
]
]
]
}
12 changes: 5 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@

"extends": ["eslint:recommended", "plugin:react/recommended"],

"plugins": [
"react",
"import"
],
"plugins": ["react", "import"],

"rules": {
"semi": [2, "never"],
Expand All @@ -27,13 +24,14 @@
"no-unused-vars": 2,
"no-multi-spaces": 1,
"camelcase": 1,
"no-use-before-define": [2,"nofunc"],
"no-use-before-define": [2, "nofunc"],
"no-underscore-dangle": 0,
"no-unused-expressions": 1,
"comma-dangle": 0,
"no-console": ["error", { allow: ["warn", "error"] }],
"no-console": ["error", { "allow": ["warn", "error"] }],
"react/jsx-no-bind": [1, { "allowArrowFunctions": true }], // TODO: make this an error
"react/display-name": 0,
"import/no-extraneous-dependencies": [2]
"import/no-extraneous-dependencies": [2],
"no-useless-escape": 1
}
}
5 changes: 5 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
semi: false
trailingComma: es5
endOfLine: lf
requirePragma: true
insertPragma: true
9 changes: 0 additions & 9 deletions dist/validation.worker.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/validation.worker.js.map

This file was deleted.

174 changes: 0 additions & 174 deletions make-webpack-config.js

This file was deleted.

Loading

0 comments on commit c60ee58

Please sign in to comment.