mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 13:08:13 +08:00
perf: transpile js to es6 (#3699)
This commit is contained in:
parent
951f58e567
commit
12ef1bfdbb
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
yarnPath: .yarn/releases/yarn-3.1.0.cjs
|
@ -1,19 +1,36 @@
|
||||
module.exports = {
|
||||
assumptions: {
|
||||
// Defines assumptions Babel can make about our
|
||||
// code to better optimise it.
|
||||
//
|
||||
// These are rarely used features that are generally
|
||||
// considered very bad practice anyway.
|
||||
//
|
||||
// See: https://babeljs.io/docs/en/assumptions
|
||||
constantSuper: true,
|
||||
ignoreFunctionLength: true,
|
||||
noDocumentAll: true,
|
||||
noNewArrows: true,
|
||||
privateFieldsAsProperties: true,
|
||||
},
|
||||
targets: {
|
||||
// `not android > 0` means the build-in Android browser used up to Android 4.4 KitKat.
|
||||
browsers: '>0.2%, not dead, not android > 0, not operamini all',
|
||||
},
|
||||
presets: [
|
||||
require.resolve('@babel/preset-react'),
|
||||
require.resolve('@babel/preset-typescript'),
|
||||
[
|
||||
require.resolve('@babel/preset-env'),
|
||||
{
|
||||
modules: false,
|
||||
loose: true,
|
||||
modules: 'auto',
|
||||
},
|
||||
],
|
||||
],
|
||||
plugins: [
|
||||
[require.resolve('@babel/plugin-transform-runtime'), { useESModules: true }],
|
||||
[require.resolve('@babel/plugin-proposal-class-properties'), { loose: true }],
|
||||
[require.resolve('@babel/plugin-proposal-private-methods'), { loose: true }],
|
||||
[require.resolve('@babel/plugin-proposal-class-properties')],
|
||||
[require.resolve('@babel/plugin-proposal-private-methods')],
|
||||
[
|
||||
require.resolve('@babel/plugin-transform-react-jsx'),
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ const plugins = [];
|
||||
* is required at build-time from an extension/core's scope) are redirected to the
|
||||
* copy of `@babel/runtime` which is a dependency of this package.
|
||||
*
|
||||
* This removes the need for hoisting, and allows for Plyug'n'Play compatibility.
|
||||
* This removes the need for hoisting, and allows for Plug'n'Play compatibility.
|
||||
*
|
||||
* Thanks goes to Yarn's lead maintainer @arcanis for helping me get to this
|
||||
* solution.
|
||||
|
@ -5,27 +5,31 @@
|
||||
"main": "index.js",
|
||||
"author": "Flarum Team",
|
||||
"license": "MIT",
|
||||
"prettier": "@flarum/prettier-config",
|
||||
"peerDependencies": {
|
||||
"webpack": "^5.76.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.16.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
||||
"@babel/plugin-proposal-private-methods": "^7.16.0",
|
||||
"@babel/plugin-transform-object-assign": "^7.16.0",
|
||||
"@babel/plugin-transform-react-jsx": "^7.16.0",
|
||||
"@babel/plugin-transform-runtime": "^7.16.0",
|
||||
"@babel/preset-env": "^7.16.0",
|
||||
"@babel/preset-react": "^7.16.0",
|
||||
"@babel/preset-typescript": "^7.16.0",
|
||||
"@babel/runtime": "^7.16.0",
|
||||
"babel-loader": "^8.2.3",
|
||||
"typescript": "^4.4.4",
|
||||
"@babel/core": "^7.20.2",
|
||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
||||
"@babel/plugin-transform-object-assign": "^7.18.6",
|
||||
"@babel/plugin-transform-react-jsx": "^7.19.0",
|
||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||
"@babel/preset-env": "^7.20.2",
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@babel/preset-typescript": "^7.18.6",
|
||||
"@babel/runtime": "^7.20.1",
|
||||
"babel-loader": "^9.1.0",
|
||||
"typescript": "^4.9.3",
|
||||
"webpack": "^5.76.0",
|
||||
"webpack-bundle-analyzer": "^4.5.0"
|
||||
"webpack-bundle-analyzer": "^4.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "^2.4.1"
|
||||
"prettier": "^2.8.0",
|
||||
"@flarum/prettier-config": "^1.0.0"
|
||||
},
|
||||
"packageManager": "yarn@3.1.0"
|
||||
"scripts": {
|
||||
"format": "prettier --write ."
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user