This is a question and/or an issue, since at this stage I'm not sure if I'm doing something wrong.
I can't seem to make react-templates, TypeScript and Webpack work together.
Of course, both TemplateExample.ts and TemplateExample.rt are in the same folder.
Error message
ERROR in /Users/david/Code/platypus/client/src/components/_Integration/TemplateExample.ts
./src/components/_Integration/TemplateExample.ts
[tsl] ERROR in /Users/david/Code/platypus/client/src/components/_Integration/TemplateExample.ts(11,27)
TS2307: Cannot find module '/Users/david/Code/platypus/client/src/components/_Integration/TemplateExample.rt'.
I tried to change the modules option of the Webpack loader to typescript , in which case I get this error (which clarifies that the issue is not with the location of the template file):
ERROR in ./src/components/_Integration/TemplateExample.rt
Module parse failed: Unexpected token (1:13)
You may need an appropriate loader to handle this file type.
| import React = require('react');
| import _ = require('lodash');
| export = function() { return React.createElement('div',{},React.createElement('strong',{},"Hello ",(this.getWorld())," :)")) };
@ ./src/components/_Integration/TemplateExample.ts 20:15-46
@ ./src/components/Router.tsx
@ ./src/components/App.tsx
@ ./src/components/Root.tsx
@ ./src/app.tsx
@ multi ./src/app.tsx
Hi,
This is a question and/or an issue, since at this stage I'm not sure if I'm doing something wrong. I can't seem to make
react-templates
, TypeScript and Webpack work together.webpack.config.js
:TemplateExample.ts
:TemplateExample.rt
:Of course, both
TemplateExample.ts
andTemplateExample.rt
are in the same folder.Error message
I tried to change the
modules
option of the Webpack loader totypescript
, in which case I get this error (which clarifies that the issue is not with the location of the template file):Any feedback would be welcome!