From e69e7be1d927aa611b2e74a615c70a27735ef950 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 29 Jul 2018 15:31:54 +0800 Subject: [PATCH] Use webpack instead of parcel --- .babelrc | 10 +- .gitignore | 1 + package.json | 54 +- .../src/components/common/Previewer.vue | 3 +- resources/assets/src/components/route.js | 7 + .../assets/src/images/textures/steve.png | Bin 0 -> 1350 bytes resources/assets/src/index.js | 16 + resources/assets/src/js/i18n.js | 66 + resources/assets/src/js/index.js | 3 + resources/assets/src/js/jquery.js | 3 + resources/assets/src/js/layout.js | 5 + resources/assets/src/js/net.js | 10 + resources/assets/src/js/notify.js | 73 + resources/views/common/dependencies/style.tpl | 8 +- webpack.config.js | 93 + yarn.lock | 4166 +++++++---------- 16 files changed, 1896 insertions(+), 2622 deletions(-) create mode 100644 resources/assets/src/components/route.js create mode 100644 resources/assets/src/images/textures/steve.png create mode 100644 resources/assets/src/index.js create mode 100644 resources/assets/src/js/i18n.js create mode 100644 resources/assets/src/js/index.js create mode 100644 resources/assets/src/js/jquery.js create mode 100644 resources/assets/src/js/layout.js create mode 100644 resources/assets/src/js/net.js create mode 100644 resources/assets/src/js/notify.js create mode 100644 webpack.config.js diff --git a/.babelrc b/.babelrc index 95d92557..4db73b97 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,6 @@ { "presets": [ - ["env", { + ["@babel/env", { "targets": { "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] }, @@ -9,13 +9,13 @@ }] ], "plugins": [ - "transform-node-env-inline" + "@babel/syntax-dynamic-import", + "@babel/proposal-optional-catch-binding" ], "env": { "test": { - "presets": [["env", { "targets": { "node": "current" } }]], - "plugins": [ - "transform-remove-console" + "presets": [ + ["@babel/env", { "targets": { "node": "current" } }] ] } } diff --git a/.gitignore b/.gitignore index 4ce2fbc1..6d538ea9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ coverage .idea/ .cache/ +.cache-loader/ vendor/* storage/textures/* storage/update_cache/* diff --git a/package.json b/package.json index 21ec5b42..fd14a912 100644 --- a/package.json +++ b/package.json @@ -10,13 +10,12 @@ "license": "GPL-3.0", "private": true, "scripts": { - "dev": "parcel watch -d public resources/assets/src/components/index.js", - "build": "parcel build -d public --no-source-maps resources/assets/src/components/index.js && yarn build:polyfill", - "build:polyfill": "parcel build -d public --no-source-maps resources/assets/src/js/polyfill.js", + "dev": "webpack --mode=development --watch", + "build": "webpack --mode=production -p", "lint": "eslint --ext=.js,.vue -f=beauty .", - "release": "gulp zip", "test": "jest", - "codecov": "codecov -F js" + "codecov": "codecov -F js", + "postinstall": "rimraf node_modules/jest-runtime/node_modules/babel-core node_modules/jest-config/node_modules/babel-core" }, "dependencies": { "admin-lte": "^2.4.2", @@ -29,10 +28,8 @@ "font-awesome": "^4.7.0", "highlight.js": "^9.12.0", "icheck": "^1.0.2", - "jqPaginator": "^1.2.0", "jquery": "^3.3.1", "lodash.debounce": "^4.0.8", - "regenerator": "^0.12.3", "skinview3d": "^1.1.0-alpha.4", "sweetalert2": "^6.11.5", "toastr": "^2.1.4", @@ -40,37 +37,42 @@ "vuejs-paginate": "^2.0.1" }, "devDependencies": { + "@babel/core": "^7.0.0-beta.54", + "@babel/plugin-proposal-optional-catch-binding": "^7.0.0-beta.54", + "@babel/plugin-syntax-dynamic-import": "^7.0.0-beta.54", + "@babel/preset-env": "^7.0.0-beta.54", "@types/jest": "^23.3.1", "@types/jquery": "^3.3.5", - "@vue/component-compiler-utils": "^2.1.0", "@vue/test-utils": "^1.0.0-beta.21", + "autoprefixer": "^9.0.1", + "babel-core": "7.0.0-bridge.0", "babel-eslint": "^8.2.6", - "babel-plugin-transform-node-env-inline": "^0.4.3", - "babel-plugin-transform-remove-console": "^6.9.0", + "babel-jest": "^23.4.2", + "babel-loader": "^8.0.0-beta.4", "codecov": "^3.0.0", - "del": "^3.0.0", + "copy-webpack-plugin": "^4.5.2", + "css-loader": "^1.0.0", + "cssnano": "^4.0.4", "eslint": "^5.2.0", "eslint-formatter-beauty": "^3.0.0-beta.2", "eslint-plugin-vue": "^5.0.0-beta.1", - "gulp": "^3.9.1", - "gulp-babel": "^6.1.3", - "gulp-batch-replace": "^0.0.0", - "gulp-clean-css": "^3.9.2", - "gulp-concat": "^2.6.1", - "gulp-notify": "^3.2.0", - "gulp-sourcemaps": "^2.6.4", - "gulp-stylus": "^2.7.0", - "gulp-uglify": "^3.0.0", - "gulp-zip": "^4.1.0", + "file-loader": "^1.1.11", "jest": "^23.4.1", "jest-extended": "^0.7.2", - "merge2": "^1.2.1", - "parcel-bundler": "^1.9.7", - "run-sequence": "^2.2.1", + "mini-css-extract-plugin": "^0.4.1", + "postcss-loader": "^2.1.6", + "rimraf": "^2.6.2", + "style-loader": "^0.21.0", "stylus": "^0.54.5", - "vue-hot-reload-api": "^2.3.0", + "stylus-loader": "^3.0.2", + "url-loader": "^1.0.1", "vue-jest": "^2.6.0", - "vue-template-compiler": "^2.5.16" + "vue-loader": "^15.2.6", + "vue-template-compiler": "^2.5.16", + "webpack": "^4.16.3", + "webpack-cli": "^3.1.0", + "webpackbar": "^2.6.1", + "yaml-loader": "^0.5.0" }, "jest": { "transform": { diff --git a/resources/assets/src/components/common/Previewer.vue b/resources/assets/src/components/common/Previewer.vue index d77d98dd..311780bc 100644 --- a/resources/assets/src/components/common/Previewer.vue +++ b/resources/assets/src/components/common/Previewer.vue @@ -49,6 +49,7 @@