提交 8a06c7b0 编写于 作者: N nkzawa

example: fix style

上级 5ef34c6d
......@@ -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}
......
// 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
}
}
}
......@@ -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.
先完成此消息的编辑!
想要评论请 注册