mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
build: BABEL! BABEL! BABEL!
This commit is contained in:
parent
cef3513755
commit
bb652c55b7
4 changed files with 670 additions and 1445 deletions
16
.babelrc
16
.babelrc
|
|
@ -1,18 +1,18 @@
|
|||
{
|
||||
"presets": [
|
||||
[
|
||||
"babel-preset-env",
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"chrome": "60"
|
||||
}
|
||||
"chrome": "67"
|
||||
},
|
||||
}
|
||||
],
|
||||
"react"
|
||||
"@babel/preset-typescript",
|
||||
"@babel/preset-react",
|
||||
],
|
||||
"plugins": [
|
||||
"transform-decorators-legacy",
|
||||
"transform-class-properties",
|
||||
["transform-object-rest-spread", { "useBuiltIns": true }]
|
||||
"@babel/plugin-proposal-class-properties",
|
||||
"@babel/plugin-proposal-object-rest-spread"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
19
package.json
19
package.json
|
|
@ -24,6 +24,13 @@
|
|||
"safe-touch": "^0.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.2.3",
|
||||
"@babel/core": "^7.3.4",
|
||||
"@babel/plugin-proposal-class-properties": "^7.3.4",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.3.4",
|
||||
"@babel/preset-env": "^7.3.4",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@babel/preset-typescript": "^7.3.3",
|
||||
"@svgr/webpack": "^4.1.0",
|
||||
"@types/chrome": "^0.0.77",
|
||||
"@types/ini": "^1.3.30",
|
||||
|
|
@ -32,16 +39,8 @@
|
|||
"@types/nprogress": "^0.0.29",
|
||||
"@types/react": "^16.8.2",
|
||||
"@types/react-dom": "^16.8.0",
|
||||
"awesome-typescript-loader": "^5.2.1",
|
||||
"babel-core": "^6.26.0",
|
||||
"babel-eslint": "^8.2.3",
|
||||
"babel-loader": "^7.1.2",
|
||||
"babel-plugin-react-require": "^3.0.0",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-decorators-legacy": "^1.3.5",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-loader": "^8.0.5",
|
||||
"copy-webpack-plugin": "^4.6.0",
|
||||
"css-loader": "^0.28.7",
|
||||
"eslint": "^4.19.1",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
const webpack = require('webpack')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const UglifyJSWebpackPlugin = require('uglifyjs-webpack-plugin')
|
||||
const { CheckerPlugin } = require('awesome-typescript-loader')
|
||||
const path = require('path')
|
||||
|
||||
const srcPath = path.resolve(__dirname, 'src')
|
||||
|
|
@ -19,7 +18,6 @@ const plugins = [
|
|||
},
|
||||
]),
|
||||
new webpack.SourceMapDevToolPlugin({}),
|
||||
new CheckerPlugin(),
|
||||
]
|
||||
|
||||
const IN_PRODUCTION_MODE = process.env.NODE_ENV === 'production'
|
||||
|
|
@ -57,18 +55,13 @@ module.exports = {
|
|||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
test: /\.tsx?$/,
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
cacheDirectory: true,
|
||||
},
|
||||
include: [srcPath, packagesPath],
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
include: [srcPath],
|
||||
loader: 'awesome-typescript-loader',
|
||||
},
|
||||
{
|
||||
test: /\.less$/,
|
||||
loader: ['style-loader', 'css-loader', 'less-loader'],
|
||||
|
|
|
|||
Loading…
Reference in a new issue