1
0
mirror of synced 2025-12-10 08:28:08 +08:00

chore: check es5

This commit is contained in:
redhoodsu
2022-07-01 18:43:59 +08:00
parent 1fa9cd0fbb
commit 5823e12aa1
6 changed files with 38 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
const BundleAnalyzerPlugin =
require('webpack-bundle-analyzer').BundleAnalyzerPlugin
exports = require('./webpack.release')
exports = require('./webpack.prod')
exports.plugins.push(new BundleAnalyzerPlugin())

View File

@@ -39,7 +39,7 @@ module.exports = {
static: {
directory: path.join(__dirname, '../test'),
},
port: 3000,
port: 8080,
},
output: {
path: path.resolve(__dirname, '../dist'),

View File

@@ -1,4 +1,5 @@
const webpack = require('webpack')
const TerserPlugin = require('terser-webpack-plugin')
exports = require('./webpack.base')
@@ -10,5 +11,13 @@ exports.plugins = exports.plugins.concat([
ENV: '"production"',
}),
])
exports.optimization = {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false,
}),
],
}
module.exports = exports

View File

@@ -4,15 +4,17 @@
"description": "Console for Mobile Browsers",
"main": "eruda.js",
"types": "types/index.d.ts",
"browserslist": "> 0.25%, not dead",
"scripts": {
"ci": "npm run lint && npm run test && npm run build",
"build": "webpack --config build/webpack.release.js && node build/build && lsla shx cp README.md dist",
"ci": "npm run lint && npm run test && npm run build && npm run es5",
"build": "lsla shx rm -rf dist && webpack --config build/webpack.prod.js && node build/build && lsla shx cp README.md dist",
"build:analyser": "webpack --config build/webpack.analyser.js",
"dev": "webpack-dev-server --config build/webpack.dev.js --host 0.0.0.0",
"test": "karma start",
"format": "lsla prettier *.js src/**/*.{js,scss,css} build/*.js test/*.{js,html} --write",
"lint": "eslint src/**/*.js",
"lint:fix": "npm run lint -- --fix",
"es5": "es-check es5 dist/eruda.js",
"setup": "lsla shx mkdir -p test/lib && lsla shx cp node_modules/jasmine-core/lib/jasmine-core/{jasmine.css,jasmine.js,jasmine-html.js,boot.js} test/lib && lsla shx cp node_modules/jasmine-jquery/lib/jasmine-jquery.js test/lib && lsla shx cp node_modules/jquery/dist/jquery.js test/lib",
"genIcon": "lsla genIcon --input src/style/icon --output src/style/icon.css --name eruda-icon && prettier src/**/*.css --write",
"genUtilDoc": "eustia doc src/lib/util.js -f md -o doc/UTIL_API.md -t \"Eruda Util Documentation\""
@@ -33,17 +35,18 @@
},
"homepage": "https://eruda.liriliri.io/",
"devDependencies": {
"@babel/core": "^7.8.6",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.8.6",
"@babel/runtime": "^7.8.4",
"@babel/core": "^7.18.6",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-runtime": "^7.18.6",
"@babel/preset-env": "^7.18.6",
"@babel/runtime": "^7.18.6",
"autoprefixer": "^9.7.4",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.0.6",
"chobitsu": "^0.3.3",
"babel-loader": "^8.2.5",
"chobitsu": "^0.4.0",
"css-loader": "^3.4.2",
"draggabilly": "^2.2.0",
"es-check": "^6.2.1",
"eslint": "^6.8.0",
"eslint-loader": "^3.0.3",
"eustia-module": "^1.30.0",
@@ -63,17 +66,17 @@
"karma-jquery": "^0.2.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^5.0.0",
"licia": "^1.30.0",
"luna-console": "^0.2.1",
"luna-notification": "^0.1.3",
"luna-object-viewer": "^0.2.0",
"licia": "^1.36.0",
"luna-console": "^0.3.1",
"luna-notification": "^0.1.4",
"luna-object-viewer": "^0.2.1",
"node-sass": "^7.0.1",
"postcss-clean": "^1.1.0",
"postcss-loader": "^3.0.0",
"postcss-prefixer": "^2.1.2",
"sass-loader": "^13.0.2",
"webpack": "^5.73.0",
"webpack-bundle-analyzer": "^3.6.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3"
}

View File

@@ -4,4 +4,5 @@
<div class="eruda-bottom-bar"></div>
</div>
<div {{{class 'tools'}}}></div>
<div class="eruda-notification"></div>
</div>

View File

@@ -217,12 +217,15 @@ export default class DevTools extends Emitter {
this._navBar.on('showTool', (name) => this.showTool(name))
}
_initNotification() {
this._notification = new LunaNotification(this._$el.get(0), {
position: {
x: 'center',
y: 'top',
},
})
this._notification = new LunaNotification(
this._$el.find('.eruda-notification').get(0),
{
position: {
x: 'center',
y: 'top',
},
}
)
}
_bindEvent() {
const $navBar = this._$el.find('.eruda-nav-bar')