Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoCo_Code_Op2
next.js
提交
8a06c7b0
N
next.js
项目概览
CoCo_Code_Op2
/
next.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
next.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8a06c7b0
编写于
1月 15, 2017
作者:
N
nkzawa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
example: fix style
上级
5ef34c6d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
1 addition
and
35 deletion
+1
-35
examples/with-styletron/pages/_document.js
examples/with-styletron/pages/_document.js
+1
-1
server/build/plugins/watch-remove-event-plugin.js
server/build/plugins/watch-remove-event-plugin.js
+0
-32
server/build/webpack.js
server/build/webpack.js
+0
-2
未找到文件。
examples/with-styletron/pages/_document.js
浏览文件 @
8a06c7b0
...
...
@@ -16,7 +16,7 @@ export default class MyDocument extends Document {
<
title
>
My
page
<
/title
>
{
this
.
props
.
stylesheets
.
map
((
sheet
,
i
)
=>
(
<
style
className
=
"
_styletron_hydrate_
"
className
=
'
_styletron_hydrate_
'
dangerouslySetInnerHTML
=
{{
__html
:
sheet
.
css
}}
media
=
{
sheet
.
media
||
''
}
key
=
{
i
}
...
...
server/build/plugins/watch-remove-event-plugin.js
已删除
100644 → 0
浏览文件 @
5ef34c6d
// watch and trigger file remove event
// see: https://github.com/webpack/webpack/issues/1533
export
default
class
WatchRemoveEventPlugin
{
constructor
()
{
this
.
removedFiles
=
[]
}
apply
(
compiler
)
{
compiler
.
removedFiles
=
[]
if
(
!
compiler
.
watchFileSystem
)
return
const
{
watchFileSystem
}
=
compiler
const
{
watch
}
=
watchFileSystem
watchFileSystem
.
watch
=
(
files
,
dirs
,
missing
,
startTime
,
options
,
callback
,
callbackUndelayed
)
=>
{
const
result
=
watch
.
call
(
watchFileSystem
,
files
,
dirs
,
missing
,
startTime
,
options
,
(...
args
)
=>
{
compiler
.
removedFiles
=
this
.
removedFiles
this
.
removedFiles
=
[]
callback
(...
args
)
},
callbackUndelayed
)
const
watchpack
=
watchFileSystem
.
watcher
watchpack
.
on
(
'
remove
'
,
(
file
)
=>
{
this
.
removedFiles
.
push
(
file
)
})
return
result
}
}
}
server/build/webpack.js
浏览文件 @
8a06c7b0
...
...
@@ -8,7 +8,6 @@ import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin'
import
CaseSensitivePathPlugin
from
'
case-sensitive-paths-webpack-plugin
'
import
UnlinkFilePlugin
from
'
./plugins/unlink-file-plugin
'
import
WatchPagesPlugin
from
'
./plugins/watch-pages-plugin
'
import
WatchRemoveEventPlugin
from
'
./plugins/watch-remove-event-plugin
'
import
JsonPagesPlugin
from
'
./plugins/json-pages-plugin
'
import
getConfig
from
'
../config
'
...
...
@@ -87,7 +86,6 @@ export default async function createCompiler (dir, { dev = false, quiet = false
new
webpack
.
HotModuleReplacementPlugin
(),
new
webpack
.
NoEmitOnErrorsPlugin
(),
new
UnlinkFilePlugin
(),
new
WatchRemoveEventPlugin
(),
new
WatchPagesPlugin
(
dir
)
)
if
(
!
quiet
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录