I’ve added the raw-loader and the following to my webpack config:
{ test: /\.txt$/, loader: 'raw', }
And this to my js:
import {exercices} from 'data/exercices.txt';
But no matter where I put the file it says it can’t be found.
Module build failed: Error: Cannot resolve module 'exercices.txt' in /Users/...
It seems to be trying to find it in the same folder as the rest of the content for that page (js, css, html) etc. nested in the app folder.
The 3 problems with that are that that’s not where I want to keep the data file, even if I do put it there it still can’t find it, and it’s still not moving it to the www folder.
I tried removing the loader and just using Node’s require but Webpack insists on sticking its fingers in and complaining when it finds the require but not the file.