diff --git a/package.json b/package.json index 6079099..b031267 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "prepublish": "npm run build" }, "main": "dist/vue-at.js", - "dependencies": {}, "engines": { "node": "14.x" }, @@ -19,42 +18,42 @@ "vue": "2.x" }, "devDependencies": { - "@babel/core": "^7.18.6", + "@babel/core": "^7.18.9", "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-decorators": "^7.18.6", + "@babel/plugin-proposal-decorators": "^7.18.9", "@babel/plugin-proposal-do-expressions": "^7.18.6", - "@babel/plugin-proposal-export-default-from": "^7.18.6", - "@babel/plugin-proposal-export-namespace-from": "^7.18.6", - "@babel/plugin-proposal-function-bind": "^7.18.6", + "@babel/plugin-proposal-export-default-from": "^7.18.9", + "@babel/plugin-proposal-export-namespace-from": "^7.18.9", + "@babel/plugin-proposal-function-bind": "^7.18.9", "@babel/plugin-proposal-function-sent": "^7.18.6", "@babel/plugin-proposal-json-strings": "^7.18.6", - "@babel/plugin-proposal-logical-assignment-operators": "^7.18.6", + "@babel/plugin-proposal-logical-assignment-operators": "^7.18.9", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", "@babel/plugin-proposal-numeric-separator": "^7.18.6", - "@babel/plugin-proposal-optional-chaining": "^7.18.6", - "@babel/plugin-proposal-pipeline-operator": "^7.18.6", + "@babel/plugin-proposal-optional-chaining": "^7.18.9", + "@babel/plugin-proposal-pipeline-operator": "^7.18.9", "@babel/plugin-proposal-throw-expressions": "^7.18.6", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-import-meta": "^7.10.4", - "@babel/preset-env": "^7.18.6", + "@babel/preset-env": "^7.18.9", "babel-loader": "^8.2.5", - "babel-preset-minify": "^0.5.1", + "babel-preset-minify": "^0.5.2", "cross-env": "^7.0.3", "css-loader": "^0.28.11", "element-ui": "^2.15.9", - "file-loader": "^1.1.9", - "node-sass": "^7.0.1", - "sass-loader": "^10.3.1", - "style-loader": "^0.23.1", + "file-loader": "^6.2.0", + "sass": "^1.53.0", + "sass-loader": "^13.0.2", + "style-loader": "^3.3.1", + "terser-webpack-plugin": "^5.3.3", "textarea-caret": "^3.1.0", - "uglifyjs-webpack-plugin": "^1.3.0", "url-loader": "^4.1.1", - "vue": "^2.6.14", + "vue": "^2.7.8", "vue-loader": "^14.2.4", "vue-style-loader": "^4.1.3", - "vue-template-compiler": "^2.6.14", + "vue-template-compiler": "^2.7.8", "vuetify": "^2.6.7", - "webpack": "^4.46.0", + "webpack": "^5.73.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^3.11.0" } diff --git a/webpack/base.js b/webpack/base.js index 2a8d1f3..5480824 100644 --- a/webpack/base.js +++ b/webpack/base.js @@ -6,42 +6,53 @@ module.exports = { rules: [ { test: /\.vue$/, - loader: 'vue-loader', - options: { - loaders: { - // Since sass-loader (weirdly) has SCSS as its default parse mode, we map - // the "scss" and "sass" values for the lang attribute to the right configs here. - // other preprocessors should work out of the box, no loader config like this nessessary. - 'scss': 'vue-style-loader!css-loader!sass-loader', - 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax' - } - // other vue-loader options go here - } + use: ['vue-loader'] + }, + { + test: /\.scss$/, + use: [ + 'vue-style-loader', + 'css-loader', + 'sass-loader', + ] + }, + { + test: /\.sass$/, + use: [ + 'vue-style-loader', + 'css-loader', + 'sass-loader?indentedSyntax', + ] }, { test: /\.js$/, - loader: 'babel-loader', + use: ['babel-loader'], exclude: [/node_modules/, path.resolve(__dirname, '../dist')] }, { test: /\.css$/, - loader: 'style-loader!css-loader' + use: ['style-loader', 'css-loader'], }, { test: /\.(ttf|woff)$/, - loader: 'url-loader' + use: ['url-loader'], }, { test: /\.(png|jpg|gif|svg)$/, - loader: 'file-loader', - options: { - name: '[name].[ext]?[hash]' - } + use: [ + { + loader: 'file-loader', + options: { + name: '[name].[ext]?[hash]' + } + } + ] } ] }, resolve: { alias: { + 'vue$': 'vue/dist/vue.esm.js' // 'vue/dist/vue.common.js' webpack // https://vuejs.org/v2/guide/installation.html#Standalone-vs-Runtime-only-Build // 'vue$': 'vue/dist/vue.common.js' } diff --git a/webpack/demo.js b/webpack/demo.js index c8a1b10..c640678 100644 --- a/webpack/demo.js +++ b/webpack/demo.js @@ -17,7 +17,7 @@ Object.assign(config, { historyApiFallback: true, noInfo: true }, - devtool: isProd ? false : '#eval-source-map', + devtool: isProd ? false : 'eval-source-map', plugins: [ new webpack.DefinePlugin({ 'process.env': { diff --git a/webpack/prod.js b/webpack/prod.js index d8d87a6..bb9364f 100644 --- a/webpack/prod.js +++ b/webpack/prod.js @@ -1,4 +1,4 @@ -var UglifyJsPlugin = require('uglifyjs-webpack-plugin') +const TerserPlugin = require("terser-webpack-plugin"); var path = require('path') var webpack = require('webpack') var base = require('./base') @@ -14,7 +14,7 @@ Object.assign(config, { filename: '[name].js', libraryTarget: 'commonjs2' }, - devtool: '#source-map', + devtool: 'source-map', plugins: [ new webpack.DefinePlugin({ 'process.env': { @@ -28,24 +28,17 @@ Object.assign(config, { 'vue', 'textarea-caret' ]), - // todo: upgrade webpack to 3.x - // switched to uglifyjs-webpack-plugin - // https://github.com/vuejs-templates/webpack/blob/cd4d7d957c9af3d37092c79bf490b56b8d88b108/template/build/webpack.prod.conf.js#L37 - new UglifyJsPlugin({ - uglifyOptions: { - compress: { - warnings: false + ], + optimization: { + minimize: true, + minimizer: [ + new TerserPlugin({ + parallel: true, + terserOptions: { + compress: true, + sourceMap: true } - }, - sourceMap: true, - parallel: true - }) - // http://vue-loader.vuejs.org/en/workflow/production.html - // new webpack.optimize.UglifyJsPlugin({ - // sourceMap: true, - // compress: { - // warnings: false - // } - // }) - ] + }), + ] + } })