Aframe: requiring from NPM with webpack gives warning "This seems to be a pre-built javascript file "

Created on 27 Feb 2016  路  4Comments  路  Source: aframevr/aframe

Most helpful comment

Fix this by adding this into your webpack config under module:

module: {
    noParse: [
      /node_modules\/aframe\/dist\/aframe.js/, // for aframe from NPM
      /node_modules\/cannon\/build\/cannon.js/, // for aframe-extras from NPM
    ],
    loaders: [
    // ... your loaders here ...
    ]
}

All 4 comments

Seeing the same thing:

WARNING in ./~/aframe/dist/aframe.js
Critical dependencies:
1:479-486 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
 @ ./~/aframe/dist/aframe.js 1:479-486

Fix this by adding this into your webpack config under module:

module: {
    noParse: [
      /node_modules\/aframe\/dist\/aframe.js/, // for aframe from NPM
      /node_modules\/cannon\/build\/cannon.js/, // for aframe-extras from NPM
    ],
    loaders: [
    // ... your loaders here ...
    ]
}

For those still seeing this error: Using the full absolute file path to the file aframe-master.js in your node_modules should work. For example:

noParse: [
    '/node_modules/aframe/dist/aframe-master.js',
]

Tested on:

  • "aframe": "^0.5.0"
  • "aframe-react": "^4.2.4"
  • "webpack": "^1.13.1"
Was this page helpful?
0 / 5 - 0 ratings