Questions tagged [raw-loader]

40 questions
0
votes
1 answer

Cannot find module '!!raw-loader!./something.glsl' or its corresponding type declarations

I have a project initiated with create-react-app --template typescript. I need to import some files using the webpack raw-loader, so I did an npm i -D raw-loader. Now I import those like so: // eslint-disable-next-line…
Seth Lutske
  • 9,154
  • 5
  • 29
  • 78
0
votes
1 answer

Get data from file inside every folder using raw-loader

I have an example file structure: -data -cars -users Inside each of these folders (cars and users) I have a config.js file in which I export an object with data, e.g .: export default { title: 'aaa', color: 'bbb', } Question: How…
michal
  • 1,534
  • 5
  • 28
  • 62
0
votes
1 answer

Webpack how to import html template inside decorator just like Angular

I am writing a decorator for custom elements,the primary code is: interface CustomElementOptions { selector: string, template?: { default: string }; } function CustomElement(options: CustomElementOptions) { return (target:…
鸿则_
  • 314
  • 1
  • 14
0
votes
1 answer

How to read changes in file content using Vue.js

I have a Vue component called "Logs" which I use to monitor changes in my log file; this is an attempt to prevent manually checking the file. Said log file is rightly named log.txt and its loaded somewhere in my site. The first challenge was…
Mueyiwa Moses Ikomi
  • 1,069
  • 2
  • 12
  • 26
0
votes
1 answer

Import shader plain text into JS script with webpack

I have a webgl proyect and I am able to load my shaders if I hardcode them from my main.js as var fragmentShaderSource = `#version 300 es.....etc' Also if keep them in a separated JS file I can do: import { vertexShaderSource } from…
rustyBucketBay
  • 4,320
  • 3
  • 17
  • 47
0
votes
0 answers

Angular cli - import html as a module with a prefix. Webpack loader not working

I am using angular 6 and angular cli 1.7 with exported webpack, the requirement is to use amd module and import html on to the component. import * as html from 'text!./app.component.html'; @Component({ selector: 'app-root', template:…
Mathew
  • 49
  • 1
  • 3
0
votes
1 answer

How to preserve newlines in VueJS when importing text from raw-loader and formatted using showdown

I am working on a website to show basic information about a sport. I have the (small) rulebook saved as rulebook.md. My project is using webpack and the latest vue-cli and yarn. To import the rulebook I use raw-loader and pass the content to a Vue…
bugflug
  • 73
  • 2
  • 8
0
votes
0 answers

Reading contents of a file when its being handled by some loader already

rawloader is used to read a file in webpack. Lets say we want to read the contents of a file thats already being handled by another loader. Can we use the rawloader (or any other technique) to do that? Lets say .myext has a loader that returns an…
noi.m
  • 3,070
  • 5
  • 34
  • 57
0
votes
1 answer

Webpack raw loader from from public path?

I am currently using the webpack raw loader to load a file like so: import svg from '!!raw-loader!./../../public/images/svg/project/flag.svg'; I am using this with Vue.js and I would like to create a method, mixer or plugin to resolve automatically…
Stephan-v
  • 19,255
  • 31
  • 115
  • 201
0
votes
0 answers

Error using Webpack: Cant seem to set correct path for directive templates

Here below is a snippet of my directive, before without using webpack I used the templateUrl version, worked fine. Ive included also my webpack.config file. I can't seem to figure this out. function footerContent() { 'use strict'; …
alphapilgrim
  • 3,761
  • 8
  • 29
  • 58
1 2
3