supermedium / aframe-super-hot-loader

🔥 Webpack loader for hot reloading A-Frame components and shaders.
https://youtu.be/uh_RQay3x80
MIT License
87 stars 8 forks source link

Error when building example project #8

Open mwbeene opened 4 years ago

mwbeene commented 4 years ago

Hi there, I'm getting the following issue when I try to install:

ERROR in ./src/scene.html 1:14
Module parse failed: Bad escape sequence in untagged template literal (1:14)
File was processed with these loaders:
 * ./node_modules/aframe-super-hot-html-loader/index.js
 * ./node_modules/super-nunjucks-loader/index.js
 * ./node_modules/html-require-loader/index.js
You may need an additional loader to handle the result of these loaders.
> const html = `<a-scene environment="preset: forest; seed: 123; shadowSize: 5">
|   <!-- <require path="C:\directory-to\aframe-super-hot-loader\example\src\templates\assets.html"> -->
| <a-assets>
 @ ./src/index.js 10:0-23

Here are the steps I followed:

$ git clone https://github.com/supermedium/aframe-super-hot-loader
$ cd aframe-super-hot-loader/example
$ npm install
$ npm run start

I'm pretty new to webpack so I'm not sure if I'm missing a step.

Thanks!

JonLevin25 commented 2 years ago

Having the same issue, any resolution?

PeteHaughie commented 9 months ago

Create a folder called src in the root of your project, put a file called index.js inside it.

The contents of this file should be:

const Nunjucks = require('nunjucks');
const path = require('path');

const nunjucks = Nunjucks.configure(__dirname, {noCache: true});

module.exports = function (source) {
  return nunjucks.render('hot.template.js', {html: source});
};