dc7290 / template-ejs-loader

ejs-loader with webpack5 support. Chain it to html-loader and use it with html-webpack-plugin.
MIT License
24 stars 3 forks source link

Error when importing data #25

Closed Rydestudio closed 2 years ago

Rydestudio commented 2 years ago

Using data files as directed in the readme the files report as not being found. Specifically says Cannot find module 'C:somepathsomeprojectdataindex-meta.js' note when this happens the error message that shows is completely devoid of forward slashes which could be the cause of the issue.

To reproduce the error simply try to use <% const meta= require('../data/index-meta.js') %> or any path with data.

The data file is structured as shown in the readme literally exactly

module.exports = {
  title: 'Webpack Starter App',
  author: 'John Doe',
  keywords: ['lorem', 'ipsum', 'dolor', 'sit', 'amet'],
  description: 'Lorem ipsum dolor sit, amet consectetur adipisicing elit.',
  customFunction: function () {
    // ...
  },
}
dc7290 commented 2 years ago

@Rydestudio

Thanks for reporting the problem!

Is your OS Windows? Maybe it is an environment-dependent bug.

Please wait a little longer as we will add Windows to the github actions test to check it out.

Rydestudio commented 2 years ago

Ah yes I am on windows. Thank you for the reply! Hopefully this can be made to work in windows as well.

dc7290 commented 2 years ago

@Rydestudio

Now supported in Ver. 0.9.3! It worked in our test on GithubActions. Please try it in your environment.

We would be happy to hear from you again if there are other problems.