From fface1b1ce6b10a1f65b7241c230c7be88fe751e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= <327782001@qq.com> Date: Thu, 29 Jun 2023 17:07:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B7=BB=E5=8A=A0=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- change-rows-color/.gitignore | 16 +++++ change-rows-color/package-lock.json | 82 +++++++++++++++------ change-rows-color/package.json | 2 +- change-rows-color/src/index.html | 2 +- change-rows-color/webpack.config.js | 106 ++++++++++++++-------------- 5 files changed, 131 insertions(+), 77 deletions(-) create mode 100644 change-rows-color/.gitignore diff --git a/change-rows-color/.gitignore b/change-rows-color/.gitignore new file mode 100644 index 0000000..ee7d43e --- /dev/null +++ b/change-rows-color/.gitignore @@ -0,0 +1,16 @@ +### Vue template +# gitignore template for Vue.js projects +# +# Recommended template: Node.gitignore + +# TODO: where does this rule come from? +docs/_book + +# TODO: where does this rule come from? +test/ + +.idea + +node_modules + +dist \ No newline at end of file diff --git a/change-rows-color/package-lock.json b/change-rows-color/package-lock.json index 7697aca..e2a1cc4 100644 --- a/change-rows-color/package-lock.json +++ b/change-rows-color/package-lock.json @@ -5,10 +5,11 @@ "requires": true, "packages": { "": { + "name": "change-rows-color", "version": "1.0.0", "license": "ISC", "dependencies": { - "jquery": "^3.6.0" + "jquery": "^3.7.0" }, "devDependencies": { "@babel/core": "^7.14.6", @@ -1243,10 +1244,24 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001242", - "resolved": "https://registry.nlark.com/caniuse-lite/download/caniuse-lite-1.0.30001242.tgz?cache=0&sync_timestamp=1625381800338&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcaniuse-lite%2Fdownload%2Fcaniuse-lite-1.0.30001242.tgz", - "integrity": "sha1-BCAWJ6vNYNyJIR8iy+I0cwbNpGs=", - "dev": true + "version": "1.0.30001509", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001509.tgz", + "integrity": "sha512-2uDDk+TRiTX5hMcUYT/7CSyzMZxjfGu0vAUjS2g0LSD8UoXOv0LtpH4LxGMemsiPq6LCVIUjNwVM0erkOkGCDA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] }, "node_modules/chalk": { "version": "2.4.2", @@ -3545,9 +3560,9 @@ } }, "node_modules/jquery": { - "version": "3.6.0", - "resolved": "https://registry.npm.taobao.org/jquery/download/jquery-3.6.0.tgz", - "integrity": "sha1-xyoJ8Vwb3OFC9J2/EXC9+K2sJHA=" + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz", + "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ==" }, "node_modules/js-tokens": { "version": "4.0.0", @@ -6286,8 +6301,8 @@ }, "node_modules/webpack": { "version": "5.42.1", - "resolved": "https://registry.nlark.com/webpack/download/webpack-5.42.1.tgz?cache=0&sync_timestamp=1625494112198&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwebpack%2Fdownload%2Fwebpack-5.42.1.tgz", - "integrity": "sha1-M0fQ2T55/nC/YuUZgQJMgLnIw98=", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.42.1.tgz", + "integrity": "sha512-msikozzXrG2Hdx+dElq0fyNvxPFsaM2dKLc/l+xkMmhO/1qwVJ9K9gY+fi/49MYWcpSP7alnK5Q78Evrd1LiqQ==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.0", @@ -6319,12 +6334,21 @@ }, "engines": { "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } } }, "node_modules/webpack-cli": { "version": "4.7.2", - "resolved": "https://registry.nlark.com/webpack-cli/download/webpack-cli-4.7.2.tgz", - "integrity": "sha1-pxjbYA3m05BqQ1fgWa5YSon0waU=", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.2.tgz", + "integrity": "sha512-mEoLmnmOIZQNiRl0ebnjzQ74Hk0iKS5SiEEnpq3dRezoyR3yPaeQZCMCe+db4524pj1Pd5ghZXjT41KLzIhSLw==", "dev": true, "dependencies": { "@discoveryjs/json-ext": "^0.5.0", @@ -6349,6 +6373,20 @@ }, "peerDependencies": { "webpack": "4.x.x || 5.x.x" + }, + "peerDependenciesMeta": { + "@webpack-cli/generators": { + "optional": true + }, + "@webpack-cli/migrate": { + "optional": true + }, + "webpack-bundle-analyzer": { + "optional": true + }, + "webpack-dev-server": { + "optional": true + } } }, "node_modules/webpack-cli/node_modules/commander": { @@ -7830,9 +7868,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001242", - "resolved": "https://registry.nlark.com/caniuse-lite/download/caniuse-lite-1.0.30001242.tgz?cache=0&sync_timestamp=1625381800338&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcaniuse-lite%2Fdownload%2Fcaniuse-lite-1.0.30001242.tgz", - "integrity": "sha1-BCAWJ6vNYNyJIR8iy+I0cwbNpGs=", + "version": "1.0.30001509", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001509.tgz", + "integrity": "sha512-2uDDk+TRiTX5hMcUYT/7CSyzMZxjfGu0vAUjS2g0LSD8UoXOv0LtpH4LxGMemsiPq6LCVIUjNwVM0erkOkGCDA==", "dev": true }, "chalk": { @@ -9710,9 +9748,9 @@ } }, "jquery": { - "version": "3.6.0", - "resolved": "https://registry.npm.taobao.org/jquery/download/jquery-3.6.0.tgz", - "integrity": "sha1-xyoJ8Vwb3OFC9J2/EXC9+K2sJHA=" + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz", + "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ==" }, "js-tokens": { "version": "4.0.0", @@ -11948,8 +11986,8 @@ }, "webpack": { "version": "5.42.1", - "resolved": "https://registry.nlark.com/webpack/download/webpack-5.42.1.tgz?cache=0&sync_timestamp=1625494112198&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwebpack%2Fdownload%2Fwebpack-5.42.1.tgz", - "integrity": "sha1-M0fQ2T55/nC/YuUZgQJMgLnIw98=", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.42.1.tgz", + "integrity": "sha512-msikozzXrG2Hdx+dElq0fyNvxPFsaM2dKLc/l+xkMmhO/1qwVJ9K9gY+fi/49MYWcpSP7alnK5Q78Evrd1LiqQ==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", @@ -11979,8 +12017,8 @@ }, "webpack-cli": { "version": "4.7.2", - "resolved": "https://registry.nlark.com/webpack-cli/download/webpack-cli-4.7.2.tgz", - "integrity": "sha1-pxjbYA3m05BqQ1fgWa5YSon0waU=", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.2.tgz", + "integrity": "sha512-mEoLmnmOIZQNiRl0ebnjzQ74Hk0iKS5SiEEnpq3dRezoyR3yPaeQZCMCe+db4524pj1Pd5ghZXjT41KLzIhSLw==", "dev": true, "requires": { "@discoveryjs/json-ext": "^0.5.0", diff --git a/change-rows-color/package.json b/change-rows-color/package.json index 9134796..bab8678 100644 --- a/change-rows-color/package.json +++ b/change-rows-color/package.json @@ -11,7 +11,7 @@ "author": "", "license": "ISC", "dependencies": { - "jquery": "^3.6.0" + "jquery": "^3.7.0" }, "devDependencies": { "@babel/core": "^7.14.6", diff --git a/change-rows-color/src/index.html b/change-rows-color/src/index.html index e8cc46f..71d09fe 100644 --- a/change-rows-color/src/index.html +++ b/change-rows-color/src/index.html @@ -6,7 +6,7 @@ Document - + diff --git a/change-rows-color/webpack.config.js b/change-rows-color/webpack.config.js index 2dd7900..22b45c9 100644 --- a/change-rows-color/webpack.config.js +++ b/change-rows-color/webpack.config.js @@ -4,64 +4,64 @@ const path = require('path') const HtmlPlugin = require('html-webpack-plugin') // 2. new 构造函数,创建插件的实例对象 const htmlPlugin = new HtmlPlugin({ - // 指定要复制哪个页面 - template: './src/index.html', - // 指定复制出来的文件名和存放路径 - filename: './index.html' + // 指定要复制哪个页面 + template: './src/index.html', + // 指定复制出来的文件名和存放路径 + filename: './index.html' }) // 注意:左侧的 { } 是解构赋值 -const { CleanWebpackPlugin } = require('clean-webpack-plugin') +const {CleanWebpackPlugin} = require('clean-webpack-plugin') // 使用 Node.js 中的导出语法,向外导出一个 webpack 的配置对象 module.exports = { - // 在开发调试阶段,建议大家都把 devtool 的值设置为 eval-source-map - // devtool: 'eval-source-map', - // 在实际发布的时候,建议大家把 devtool 的值设置为 nosources-source-map 或直接关闭 SourceMap - devtool: 'nosources-source-map', - // mode 代表 webpack 运行的模式,可选值有两个 development 和 production - // 结论:开发时候一定要用 development,因为追求的是打包的速度,而不是体积; - // 反过来,发布上线的时候一定能要用 production,因为上线追求的是体积小,而不是打包速度快! - mode: 'development', - // entry: '指定要处理哪个文件' - entry: path.join(__dirname, './src/index1.js'), - // 指定生成的文件要存放到哪里 - output: { - // 存放的目录 - path: path.join(__dirname, 'dist'), - // 生成的文件名 - filename: 'js/bundle.js' - }, - // 3. 插件的数组,将来 webpack 在运行时,会加载并调用这些插件 - plugins: [htmlPlugin, new CleanWebpackPlugin()], - devServer: { - // 首次打包成功后,自动打开浏览器 - open: true, - // 在 http 协议中,如果端口号是 80,则可以被省略 - port: 80, - // 指定运行的主机地址 - host: '127.0.0.1' - }, - module: { - rules: [ - // 定义了不同模块对应的 loader - { test: /\.css$/, use: ['style-loader', 'css-loader'] }, - // 处理 .less 文件的 loader - { test: /\.less$/, use: ['style-loader', 'css-loader', 'less-loader'] }, - // 处理图片文件的 loader - // 如果需要调用的 loader 只有一个,则只传递一个字符串也行,如果有多个loader,则必须指定数组 - // 在配置 url-loader 的时候,多个参数之间,使用 & 符号进行分隔 - { test: /\.jpg|png|gif$/, use: 'url-loader?limit=470&outputPath=images' }, - // 使用 babel-loader 处理高级的 JS 语法 - // 在配置 babel-loader 的时候,程序员只需要把自己的代码进行转换即可;一定要排除 node_modules 目录中的 JS 文件 - // 因为第三方包中的 JS 兼容性,不需要程序员关心 - { test: /\.js$/, use: 'babel-loader', exclude: /node_modules/ } - ] - }, - resolve: { - alias: { - // 告诉 webpack,程序员写的代码中,@ 符号表示 src 这一层目录 - '@': path.join(__dirname, './src/') + // 在开发调试阶段,建议大家都把 devtool 的值设置为 eval-source-map + // devtool: 'eval-source-map', + // 在实际发布的时候,建议大家把 devtool 的值设置为 nosources-source-map 或直接关闭 SourceMap + devtool: 'nosources-source-map', + // mode 代表 webpack 运行的模式,可选值有两个 development 和 production + // 结论:开发时候一定要用 development,因为追求的是打包的速度,而不是体积; + // 反过来,发布上线的时候一定能要用 production,因为上线追求的是体积小,而不是打包速度快! + mode: 'development', + // entry: '指定要处理哪个文件' + entry: path.join(__dirname, './src/index1.js'), + // 指定生成的文件要存放到哪里 + output: { + // 存放的目录 + path: path.join(__dirname, 'dist'), + // 生成的文件名 + filename: 'js/bundle.js' + }, + // 3. 插件的数组,将来 webpack 在运行时,会加载并调用这些插件 + plugins: [htmlPlugin, new CleanWebpackPlugin()], + devServer: { + // 首次打包成功后,自动打开浏览器 + open: true, + // 在 http 协议中,如果端口号是 80,则可以被省略 + port: 8888, + // 指定运行的主机地址 + host: '127.0.0.1' + }, + module: { + rules: [ + // 定义了不同模块对应的 loader + {test: /\.css$/, use: ['style-loader', 'css-loader']}, + // 处理 .less 文件的 loader + {test: /\.less$/, use: ['style-loader', 'css-loader', 'less-loader']}, + // 处理图片文件的 loader + // 如果需要调用的 loader 只有一个,则只传递一个字符串也行,如果有多个loader,则必须指定数组 + // 在配置 url-loader 的时候,多个参数之间,使用 & 符号进行分隔 + {test: /\.jpg|png|gif$/, use: 'url-loader?limit=470&outputPath=images'}, + // 使用 babel-loader 处理高级的 JS 语法 + // 在配置 babel-loader 的时候,程序员只需要把自己的代码进行转换即可;一定要排除 node_modules 目录中的 JS 文件 + // 因为第三方包中的 JS 兼容性,不需要程序员关心 + {test: /\.js$/, use: 'babel-loader', exclude: /node_modules/} + ] + }, + resolve: { + alias: { + // 告诉 webpack,程序员写的代码中,@ 符号表示 src 这一层目录 + '@': path.join(__dirname, './src/') + } } - } } -- GitLab