fix:添加忽略文件

上级 6bd72d20
### 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
...@@ -5,10 +5,11 @@ ...@@ -5,10 +5,11 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "change-rows-color",
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"jquery": "^3.6.0" "jquery": "^3.7.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.14.6", "@babel/core": "^7.14.6",
...@@ -1243,10 +1244,24 @@ ...@@ -1243,10 +1244,24 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001242", "version": "1.0.30001509",
"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", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001509.tgz",
"integrity": "sha1-BCAWJ6vNYNyJIR8iy+I0cwbNpGs=", "integrity": "sha512-2uDDk+TRiTX5hMcUYT/7CSyzMZxjfGu0vAUjS2g0LSD8UoXOv0LtpH4LxGMemsiPq6LCVIUjNwVM0erkOkGCDA==",
"dev": true "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": { "node_modules/chalk": {
"version": "2.4.2", "version": "2.4.2",
...@@ -3545,9 +3560,9 @@ ...@@ -3545,9 +3560,9 @@
} }
}, },
"node_modules/jquery": { "node_modules/jquery": {
"version": "3.6.0", "version": "3.7.0",
"resolved": "https://registry.npm.taobao.org/jquery/download/jquery-3.6.0.tgz", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz",
"integrity": "sha1-xyoJ8Vwb3OFC9J2/EXC9+K2sJHA=" "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ=="
}, },
"node_modules/js-tokens": { "node_modules/js-tokens": {
"version": "4.0.0", "version": "4.0.0",
...@@ -6286,8 +6301,8 @@ ...@@ -6286,8 +6301,8 @@
}, },
"node_modules/webpack": { "node_modules/webpack": {
"version": "5.42.1", "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", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.42.1.tgz",
"integrity": "sha1-M0fQ2T55/nC/YuUZgQJMgLnIw98=", "integrity": "sha512-msikozzXrG2Hdx+dElq0fyNvxPFsaM2dKLc/l+xkMmhO/1qwVJ9K9gY+fi/49MYWcpSP7alnK5Q78Evrd1LiqQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/eslint-scope": "^3.7.0", "@types/eslint-scope": "^3.7.0",
...@@ -6319,12 +6334,21 @@ ...@@ -6319,12 +6334,21 @@
}, },
"engines": { "engines": {
"node": ">=10.13.0" "node": ">=10.13.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
},
"peerDependenciesMeta": {
"webpack-cli": {
"optional": true
}
} }
}, },
"node_modules/webpack-cli": { "node_modules/webpack-cli": {
"version": "4.7.2", "version": "4.7.2",
"resolved": "https://registry.nlark.com/webpack-cli/download/webpack-cli-4.7.2.tgz", "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.2.tgz",
"integrity": "sha1-pxjbYA3m05BqQ1fgWa5YSon0waU=", "integrity": "sha512-mEoLmnmOIZQNiRl0ebnjzQ74Hk0iKS5SiEEnpq3dRezoyR3yPaeQZCMCe+db4524pj1Pd5ghZXjT41KLzIhSLw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@discoveryjs/json-ext": "^0.5.0", "@discoveryjs/json-ext": "^0.5.0",
...@@ -6349,6 +6373,20 @@ ...@@ -6349,6 +6373,20 @@
}, },
"peerDependencies": { "peerDependencies": {
"webpack": "4.x.x || 5.x.x" "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": { "node_modules/webpack-cli/node_modules/commander": {
...@@ -7830,9 +7868,9 @@ ...@@ -7830,9 +7868,9 @@
"dev": true "dev": true
}, },
"caniuse-lite": { "caniuse-lite": {
"version": "1.0.30001242", "version": "1.0.30001509",
"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", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001509.tgz",
"integrity": "sha1-BCAWJ6vNYNyJIR8iy+I0cwbNpGs=", "integrity": "sha512-2uDDk+TRiTX5hMcUYT/7CSyzMZxjfGu0vAUjS2g0LSD8UoXOv0LtpH4LxGMemsiPq6LCVIUjNwVM0erkOkGCDA==",
"dev": true "dev": true
}, },
"chalk": { "chalk": {
...@@ -9710,9 +9748,9 @@ ...@@ -9710,9 +9748,9 @@
} }
}, },
"jquery": { "jquery": {
"version": "3.6.0", "version": "3.7.0",
"resolved": "https://registry.npm.taobao.org/jquery/download/jquery-3.6.0.tgz", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz",
"integrity": "sha1-xyoJ8Vwb3OFC9J2/EXC9+K2sJHA=" "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ=="
}, },
"js-tokens": { "js-tokens": {
"version": "4.0.0", "version": "4.0.0",
...@@ -11948,8 +11986,8 @@ ...@@ -11948,8 +11986,8 @@
}, },
"webpack": { "webpack": {
"version": "5.42.1", "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", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.42.1.tgz",
"integrity": "sha1-M0fQ2T55/nC/YuUZgQJMgLnIw98=", "integrity": "sha512-msikozzXrG2Hdx+dElq0fyNvxPFsaM2dKLc/l+xkMmhO/1qwVJ9K9gY+fi/49MYWcpSP7alnK5Q78Evrd1LiqQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/eslint-scope": "^3.7.0", "@types/eslint-scope": "^3.7.0",
...@@ -11979,8 +12017,8 @@ ...@@ -11979,8 +12017,8 @@
}, },
"webpack-cli": { "webpack-cli": {
"version": "4.7.2", "version": "4.7.2",
"resolved": "https://registry.nlark.com/webpack-cli/download/webpack-cli-4.7.2.tgz", "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.2.tgz",
"integrity": "sha1-pxjbYA3m05BqQ1fgWa5YSon0waU=", "integrity": "sha512-mEoLmnmOIZQNiRl0ebnjzQ74Hk0iKS5SiEEnpq3dRezoyR3yPaeQZCMCe+db4524pj1Pd5ghZXjT41KLzIhSLw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@discoveryjs/json-ext": "^0.5.0", "@discoveryjs/json-ext": "^0.5.0",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"jquery": "^3.6.0" "jquery": "^3.7.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.14.6", "@babel/core": "^7.14.6",
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title> <title>Document</title>
<!-- <script src="./index.js"></script> --> <!-- <script src="./index.js"></script>-->
<!-- <script src="../dist/main.js"></script> --> <!-- <script src="../dist/main.js"></script> -->
<!-- <script src="../dist/bundle.js"></script> --> <!-- <script src="../dist/bundle.js"></script> -->
<!-- 加载和引用内存中的 bundle.js --> <!-- 加载和引用内存中的 bundle.js -->
......
...@@ -4,64 +4,64 @@ const path = require('path') ...@@ -4,64 +4,64 @@ const path = require('path')
const HtmlPlugin = require('html-webpack-plugin') const HtmlPlugin = require('html-webpack-plugin')
// 2. new 构造函数,创建插件的实例对象 // 2. new 构造函数,创建插件的实例对象
const htmlPlugin = new HtmlPlugin({ const htmlPlugin = new HtmlPlugin({
// 指定要复制哪个页面 // 指定要复制哪个页面
template: './src/index.html', template: './src/index.html',
// 指定复制出来的文件名和存放路径 // 指定复制出来的文件名和存放路径
filename: './index.html' filename: './index.html'
}) })
// 注意:左侧的 { } 是解构赋值 // 注意:左侧的 { } 是解构赋值
const { CleanWebpackPlugin } = require('clean-webpack-plugin') const {CleanWebpackPlugin} = require('clean-webpack-plugin')
// 使用 Node.js 中的导出语法,向外导出一个 webpack 的配置对象 // 使用 Node.js 中的导出语法,向外导出一个 webpack 的配置对象
module.exports = { module.exports = {
// 在开发调试阶段,建议大家都把 devtool 的值设置为 eval-source-map // 在开发调试阶段,建议大家都把 devtool 的值设置为 eval-source-map
// devtool: 'eval-source-map', // devtool: 'eval-source-map',
// 在实际发布的时候,建议大家把 devtool 的值设置为 nosources-source-map 或直接关闭 SourceMap // 在实际发布的时候,建议大家把 devtool 的值设置为 nosources-source-map 或直接关闭 SourceMap
devtool: 'nosources-source-map', devtool: 'nosources-source-map',
// mode 代表 webpack 运行的模式,可选值有两个 development 和 production // mode 代表 webpack 运行的模式,可选值有两个 development 和 production
// 结论:开发时候一定要用 development,因为追求的是打包的速度,而不是体积; // 结论:开发时候一定要用 development,因为追求的是打包的速度,而不是体积;
// 反过来,发布上线的时候一定能要用 production,因为上线追求的是体积小,而不是打包速度快! // 反过来,发布上线的时候一定能要用 production,因为上线追求的是体积小,而不是打包速度快!
mode: 'development', mode: 'development',
// entry: '指定要处理哪个文件' // entry: '指定要处理哪个文件'
entry: path.join(__dirname, './src/index1.js'), entry: path.join(__dirname, './src/index1.js'),
// 指定生成的文件要存放到哪里 // 指定生成的文件要存放到哪里
output: { output: {
// 存放的目录 // 存放的目录
path: path.join(__dirname, 'dist'), path: path.join(__dirname, 'dist'),
// 生成的文件名 // 生成的文件名
filename: 'js/bundle.js' filename: 'js/bundle.js'
}, },
// 3. 插件的数组,将来 webpack 在运行时,会加载并调用这些插件 // 3. 插件的数组,将来 webpack 在运行时,会加载并调用这些插件
plugins: [htmlPlugin, new CleanWebpackPlugin()], plugins: [htmlPlugin, new CleanWebpackPlugin()],
devServer: { devServer: {
// 首次打包成功后,自动打开浏览器 // 首次打包成功后,自动打开浏览器
open: true, open: true,
// 在 http 协议中,如果端口号是 80,则可以被省略 // 在 http 协议中,如果端口号是 80,则可以被省略
port: 80, port: 8888,
// 指定运行的主机地址 // 指定运行的主机地址
host: '127.0.0.1' host: '127.0.0.1'
}, },
module: { module: {
rules: [ rules: [
// 定义了不同模块对应的 loader // 定义了不同模块对应的 loader
{ test: /\.css$/, use: ['style-loader', 'css-loader'] }, {test: /\.css$/, use: ['style-loader', 'css-loader']},
// 处理 .less 文件的 loader // 处理 .less 文件的 loader
{ test: /\.less$/, use: ['style-loader', 'css-loader', 'less-loader'] }, {test: /\.less$/, use: ['style-loader', 'css-loader', 'less-loader']},
// 处理图片文件的 loader // 处理图片文件的 loader
// 如果需要调用的 loader 只有一个,则只传递一个字符串也行,如果有多个loader,则必须指定数组 // 如果需要调用的 loader 只有一个,则只传递一个字符串也行,如果有多个loader,则必须指定数组
// 在配置 url-loader 的时候,多个参数之间,使用 & 符号进行分隔 // 在配置 url-loader 的时候,多个参数之间,使用 & 符号进行分隔
{ test: /\.jpg|png|gif$/, use: 'url-loader?limit=470&outputPath=images' }, {test: /\.jpg|png|gif$/, use: 'url-loader?limit=470&outputPath=images'},
// 使用 babel-loader 处理高级的 JS 语法 // 使用 babel-loader 处理高级的 JS 语法
// 在配置 babel-loader 的时候,程序员只需要把自己的代码进行转换即可;一定要排除 node_modules 目录中的 JS 文件 // 在配置 babel-loader 的时候,程序员只需要把自己的代码进行转换即可;一定要排除 node_modules 目录中的 JS 文件
// 因为第三方包中的 JS 兼容性,不需要程序员关心 // 因为第三方包中的 JS 兼容性,不需要程序员关心
{ test: /\.js$/, use: 'babel-loader', exclude: /node_modules/ } {test: /\.js$/, use: 'babel-loader', exclude: /node_modules/}
] ]
}, },
resolve: { resolve: {
alias: { alias: {
// 告诉 webpack,程序员写的代码中,@ 符号表示 src 这一层目录 // 告诉 webpack,程序员写的代码中,@ 符号表示 src 这一层目录
'@': path.join(__dirname, './src/') '@': path.join(__dirname, './src/')
}
} }
}
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册