I need to load a JS file as a string so I can run some analysis on it. I am trying to use raw-loader with Webpack (2.2.0).
I get: Cannot find module 'raw-loader!../
I've tried (yes, the path is correct):
let app = require('raw-loader!../../app.js').default;
let app = require('!!raw-loader!../../app.js').default;
I've even tried it without inline. Raw-loader doesn't get engaged, it just tried to load the JS file normally:
module.exports = {
module: {
rules: [
{
test: /\app.js$/i,
use: 'raw-loader',
loader: 'raw-loader',
}
]
}
}
raw-loader is in my package.json for the project. It is present in my node modules. I've blown-away my node_modules and have reinstalled. I've looked at many solutions and nothing seems to point to a fix.