【发布时间】:2016-04-28 19:11:34
【问题描述】:
我刚开始使用 pixi.js,它看起来很棒! 但我不能让它完全与 Gulp 和 WebPack 一起工作......
在 Chrome (Mac) 上,一切正常,但在 Safari (iPhone) 上我收到此错误:fs.readFileSync is not a function 来自 function FXAAFilter。
当我使用 forceFXAA: true 时,我在桌面上遇到同样的错误。
我的 gulp 脚本任务:
gulp
.src(config.scripts.src)
.pipe(gulp_webpack({
node: {
fs: "empty"
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /(nodes_modules)/,
loader: "babel-loader",
query: {
presets: ["es2015"]
}
},
{
test: /\.json$/,
loader: "json"
}
],
postLoaders: [
{
include: path.resolve(__dirname, "nodes_modules/pixi.js"),
loader: "transform?brfs"
}
]
},
}))
.pipe(gulp_concat(config.scripts.out))
.pipe(gulp.dest(config.scripts.dst));
【问题讨论】: