Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
澄清寰宇
webpck
提交
fd276274
W
webpck
项目概览
澄清寰宇
/
webpck
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
webpck
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
fd276274
编写于
10月 12, 2021
作者:
澄清寰宇
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交修改
上级
9b68fa64
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
124 addition
and
79 deletion
+124
-79
node_modules/accepts/index.js
node_modules/accepts/index.js
+78
-78
src/index.js
src/index.js
+9
-1
webpack.config.dev.js
webpack.config.dev.js
+37
-0
未找到文件。
node_modules/accepts/index.js
浏览文件 @
fd276274
...
...
@@ -29,7 +29,7 @@ module.exports = Accepts
* @public
*/
function
Accepts
(
req
)
{
function
Accepts
(
req
)
{
if
(
!
(
this
instanceof
Accepts
))
{
return
new
Accepts
(
req
)
}
...
...
@@ -80,7 +80,7 @@ function Accepts (req) {
*/
Accepts
.
prototype
.
type
=
Accepts
.
prototype
.
types
=
function
(
types_
)
{
Accepts
.
prototype
.
types
=
function
(
types_
)
{
var
types
=
types_
// support flattened arguments
...
...
@@ -105,10 +105,10 @@ Accepts.prototype.types = function (types_) {
var
accepts
=
this
.
negotiator
.
mediaTypes
(
mimes
.
filter
(
validMime
))
var
first
=
accepts
[
0
]
return
first
?
types
[
mimes
.
indexOf
(
first
)]
:
false
}
return
first
?
types
[
mimes
.
indexOf
(
first
)]
:
false
}
/**
* Return accepted encodings or best fit based on `encodings`.
...
...
@@ -124,7 +124,7 @@ Accepts.prototype.types = function (types_) {
*/
Accepts
.
prototype
.
encoding
=
Accepts
.
prototype
.
encodings
=
function
(
encodings_
)
{
Accepts
.
prototype
.
encodings
=
function
(
encodings_
)
{
var
encodings
=
encodings_
// support flattened arguments
...
...
@@ -141,7 +141,7 @@ Accepts.prototype.encodings = function (encodings_) {
}
return
this
.
negotiator
.
encodings
(
encodings
)[
0
]
||
false
}
}
/**
* Return accepted charsets or best fit based on `charsets`.
...
...
@@ -157,7 +157,7 @@ Accepts.prototype.encodings = function (encodings_) {
*/
Accepts
.
prototype
.
charset
=
Accepts
.
prototype
.
charsets
=
function
(
charsets_
)
{
Accepts
.
prototype
.
charsets
=
function
(
charsets_
)
{
var
charsets
=
charsets_
// support flattened arguments
...
...
@@ -174,7 +174,7 @@ Accepts.prototype.charsets = function (charsets_) {
}
return
this
.
negotiator
.
charsets
(
charsets
)[
0
]
||
false
}
}
/**
* Return accepted languages or best fit based on `langs`.
...
...
@@ -190,9 +190,9 @@ Accepts.prototype.charsets = function (charsets_) {
*/
Accepts
.
prototype
.
lang
=
Accepts
.
prototype
.
langs
=
Accepts
.
prototype
.
language
=
Accepts
.
prototype
.
languages
=
function
(
languages_
)
{
Accepts
.
prototype
.
langs
=
Accepts
.
prototype
.
language
=
Accepts
.
prototype
.
languages
=
function
(
languages_
)
{
var
languages
=
languages_
// support flattened arguments
...
...
@@ -209,7 +209,7 @@ Accepts.prototype.languages = function (languages_) {
}
return
this
.
negotiator
.
languages
(
languages
)[
0
]
||
false
}
}
/**
* Convert extnames to mime.
...
...
@@ -219,10 +219,10 @@ Accepts.prototype.languages = function (languages_) {
* @private
*/
function
extToMime
(
type
)
{
return
type
.
indexOf
(
'
/
'
)
===
-
1
?
mime
.
lookup
(
type
)
:
type
function
extToMime
(
type
)
{
return
type
.
indexOf
(
'
/
'
)
===
-
1
?
mime
.
lookup
(
type
)
:
type
}
/**
...
...
@@ -233,6 +233,6 @@ function extToMime (type) {
* @private
*/
function
validMime
(
type
)
{
function
validMime
(
type
)
{
return
typeof
type
===
'
string
'
}
\ No newline at end of file
src/index.js
浏览文件 @
fd276274
/*
* @Author: 尹鹏孝
* @Date: 2018-09-07 16:38:01
* @LastEditTime: 2021-10-12 21:09:12
* @LastEditors: Please set LastEditors
* @Description: 操作webpack
* @FilePath: /web/webpack/src/index.js
*/
import
_
from
'
lodash
'
import
printMe
from
'
./print
'
import
'
./index.css
'
...
...
@@ -23,7 +31,7 @@ function createDiv() {
document
.
body
.
appendChild
(
createDiv
())
if
(
module
.
hot
)
{
module
.
hot
.
accept
(
'
./print.js
'
,
function
()
{
module
.
hot
.
accept
(
'
./print.js
'
,
function
()
{
console
.
log
(
'
热模块替换
'
);
printMe
();
})
...
...
webpack.config.dev.js
0 → 100644
浏览文件 @
fd276274
/*
* @Author: 尹鹏孝
* @Date: 2021-10-12 20:44:57
* @LastEditTime: 2021-10-12 21:41:39
* @LastEditors: Please set LastEditors
* @Description: 配置测试环节的webpack
* @FilePath: /web/webpack/webpack.config.dev.js
*/
const
path
=
require
(
'
path
'
);
// require('style-loader!css-loader!./src/index.css?minimize')
const
ExtractTextPlugin
=
require
(
'
mini-css-extract-plugin
'
);
modules
.
export
=
{
entry
:
'
./src/index.js
'
,
output
:
{
filename
:
'
bundle.js
'
,
path
:
path
.
resolve
(
__dirname
,
'
./dist
'
)
},
module
:
{
rules
:
[{
test
:
/
\.
css$/
,
/* use: ['style-loader', 'css-loader?minimize', {
loader: 'css-loader',
options: {
minimize: true
}
}] */
loaders
:
ExtractTextPlugin
.
extract
({
use
:
[
'
css-loader
'
]
})
}]
},
plugins
:
[
new
ExtractTextPlugin
({
filename
:
[
`[name]_[contenthash:8].css`
]
})
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录