raw-loader

Webpack loader cannot find module

限于喜欢 提交于 2019-12-11 04:25:28
问题 Edit 2: The problem is not with webpack but with typescript. Something with declaring "*.md" as a module in a separate declaration file called *.d.ts Edit: Confirmed the issue is not with webpack itself, since I got the following to work: import txt from '../documents/test.md' export default { txt, } Trying to load text files for rendering client side. I'm following instructions for raw-loader: https://webpack.js.org/loaders/raw-loader/ I'm also using TypeScript. import * as React from 'react

What exactly am I supposed to do with “module.exports = 'html_template_content'” on webpack

谁说我不能喝 提交于 2019-12-09 08:38:32
问题 So I want to do a very simple task using webpack. I have a few static HTML templates like e.g. test.html <div><span>template content</span></div> and all I want to do is return the string inside the template e.g require("raw!./test.html") with should return a string like: "<div><span>template content</span></div>" but instead, it returns the following string "modules.exports = <div><span>template content</span></div>" I have tried several modules, like the raw-loader and html-loader. and they