我正在开发一个基于 pixijs 的游戏,其中动画是使用 Adobe Animate 和 Pixi-Animate 生成的,并且所有这些设置都是使用 nodejs 8.11.1 和 webpack 4 配置的。但是当我在 Pixi Animate 上加载我的纹理时出现以下错误:
这是我得到的错误:
addChild
webpack:///./node_modules/pixi.js/lib/core/display/Container.js?:94:13
<anonymous>
webpack:///./src/index.js?:10:1
./src/index.js
http://localhost:9000/salmon.min.js:2786:1
__webpack_require__
http://localhost:9000/salmon.min.js:20:12
<anonymous>
webpack:///multi_(webpack)-dev-server/client?:2:18
[0]
http://localhost:9000/salmon.min.js:2797:1
__webpack_require__
http://localhost:9000/salmon.min.js:20:12
<anonymous>
http://localhost:9000/salmon.min.js:84:18
<anonymous>
http://localhost:9000/salmon.min.js:1:11
我的 Webpack 配置是:
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
var webpack = require('webpack');
module.exports = {
entry: './src/index.js',
mode:"development",
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'salmon.min.js'
},
plugins: [
new HtmlWebpackPlugin({template: './index.html'}),
new webpack.NamedModulesPlugin(),
],
devServer:{
port: 9000,
compress: true
},
module: {
rules: [
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre"
}
]
}
};
有什么我想念的吗?