Questions tagged [webpack-loader]

141 questions
0
votes
1 answer

Does WebPack loader addDependency add a file to the bundle?

When using the WebPack Loader API, does this.addDependency also add the file to the bundle?
Resist Design
  • 4,462
  • 3
  • 22
  • 35
0
votes
1 answer

How to add an image dependency from a custom loader in webpack?

I'm trying to create a loader which will just parse the content for this syntax: {{ 'assets/someimage.png'|theme }} every matches should be added as a webpack dependency from the root webpack directory without making any change in the final's…
0
votes
1 answer

vue-loader interfering with custom plugin

To preprocess some custom non-HTML tags in a .vue file, I used to be (Webpack 3) able to install a loader via a plugin that would convert those custom tags into valid html/js code before the vue loader would see them and fail. apply(compiler) { …
orange
  • 7,755
  • 14
  • 75
  • 139
0
votes
1 answer

Register file to bundle inside loader

Is it possible to register file to bundle inside loader? Let's say I have a own loader for .cmp.html files and I require files like this: require("component/index.cmp.html"); then I'd like my loader to require also "component/index.cmp.js" to…
ElSajko
  • 1,612
  • 3
  • 17
  • 37
0
votes
1 answer

Webpack Loaders - create and write files inside loader

Pretty much what the title suggests. I want to create a metadata file alongside every javascript file in my project. So I need a webpack loader that doesn't change the content at all, and just extracts some metadata and writes it to a file. What's…
woojoo666
  • 7,801
  • 7
  • 45
  • 57
0
votes
1 answer

Webpack loaders order

I'm learning webpack .I've read about execution order of loaders.They are executed from right to left.And the result of one loader is passed to next loader,It's clear.But than I faced with such example: { test: /\.(jpe?g|png|gif|svg)$/, use: [ …
vborutenko
  • 4,323
  • 5
  • 28
  • 48
0
votes
1 answer

How to use inline tags in a React application with webpack

I'm getting an error when I compile a React application with webpack: You may need an appropriate loader to handle this file type.
Sean
  • 2,609
  • 1
  • 18
  • 34
0
votes
1 answer

Webpack Module parse failed (.po)

I have problem with webpack .po loader. What I am doing is **package.json ** - "json-loader": "^0.5.7", - "po-loader": "^0.4.2", - "po2json": "^1.0.0-alpha", In webpack entry file I am collecting my .po files (with all others .js, .css etc.) After…
JohnWayne
  • 651
  • 9
  • 28
0
votes
0 answers

how to hot reload html file in webpack

I want to build a CSS exercise book just like JSBin or Codepen with the help of webpack hot load feature. But I don't know how to make html file reload in page when it is modified. is there any loader or solution?
litbear
  • 806
  • 1
  • 6
  • 17
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

Load internal module attribute with WebPack

I'm porting an old Dojo Toolkit application to newer technologies (Vue.js and WebPack). My scenarios is... Those new modules should work with old Dojo Loader or the new WebPack loader. I was able to remove most of dojo dependencies but I still need…
sergiogarciadev
  • 2,061
  • 1
  • 21
  • 35
0
votes
1 answer

loaderUtil.getOptions returns null: "this" object is empty in loader function for Webpack 4

I'm trying to create a custom loader in order to generate the manifest.json file for a chrome extension, and for some reason I can't get access to the "options" object via loaderUtils because this is an empty object... Is there something else I…
chez.mosey
  • 194
  • 1
  • 8
0
votes
2 answers

javascript regex match file extension but excluding prefix extension

I need to match a file extension for webpack rules using regex. I want to make two separate rules for targeting svg files: *.svg and *.icon.svg. These rules must be mutually exclusive. It's easy to caputure *.icon.svg scenario by testing for…
0
votes
1 answer

How can I load "jquery-1.4.2" as a module in webpack without modifying its source

I want to include jquery-1.4.2 in parallel with jquery-3.x. I have aliased the paths of both scripts as: jquery1/jquery3 For jquery-3.x the code below works: require("imports-loader?jQuery=jquery3!app/some.jquery.myplugin"); But If i do the same…
Marinos An
  • 9,481
  • 6
  • 63
  • 96
0
votes
1 answer

Webpack loader not being used when requiring file being processed by custom loader

I'm trying to write a custom Webpack loader that reads a JavaScript file and exports SASS variables, similar to js-to-sass-var-loader but with some added functionality. /webpack-loaders/js-to-sass-loader.js import _ from 'lodash'; import path from…
dx_over_dt
  • 13,240
  • 17
  • 54
  • 102
1 2 3
9
10