Questions tagged [webpack-loader]

141 questions
1
vote
2 answers

Adding SVG Loader to Vue-cli project for a specific directory only

I am using Vue 2.6.10 in a vue-cli project. I want to use a SVG Loader in this project for SVG files from a specific directory only. These are my current rules in vue.config.js chainWebpack: (config) => { const svgRule =…
Leopold Kristjansson
  • 2,246
  • 28
  • 47
1
vote
1 answer

"exports is not defined" when loading svg icon

I'm using the svg-sprite-loader plug-in when trying to load an icon from an svg sprite file, however, the page fails with webpack error "exports is not defined". What could be happening? How can one debug webpack loaders like this and get more…
Peteris
  • 3,548
  • 4
  • 28
  • 44
1
vote
1 answer

Cannot find module (trying to load a module from a folder)

I'm new into webpack, and I'm having an issue trying to resolve a subdependency. I'm importing a dependency that is trying to require a module from a specific folder (not the node_modules) (let's call it subdependency). That folder contains two…
caraie
  • 1,094
  • 7
  • 18
1
vote
1 answer

failed to load csv file using csv-loader

I am learning webpack-loader, and using csv-loader to load a csv file. I have already install the csv-loader and add the rule. However, webpack log an error: Cannot find module 'papaparse'. How do this error happened?
Loris Lo
  • 11
  • 2
1
vote
1 answer

Override angular loaders for specific files

We have a codebase that was created using angular, which uses the angular cli and it's default webpack config. However, we are starting to move away from angular and towards webcomponents. In order to use scss within our webcomponent ts files, we…
SubliemeSiem
  • 1,129
  • 17
  • 25
1
vote
1 answer

Custom Webpack plugin: Which hook for accessing transformed code

I'm trying to get the loader transformed content of files after a certain loader in a webpack plugin has done its job. This would usually be ideal for another loader, but I also need access to a hook that is called when the translation process is…
orange
  • 7,755
  • 14
  • 75
  • 139
1
vote
1 answer

Make a function interface async without copy and paste

Webpack provides a TypeScript interface for implementing a loader: import { loader } from "webpack"; namespace loader { interface Loader extends Function { (this: LoaderContext, source: string | Buffer, sourceMap?: RawSourceMap): string |…
Lukas
  • 9,752
  • 15
  • 76
  • 120
1
vote
0 answers

Webpack loader API: Imperatively transpile code

I am writing a Webpack loader that transpiles .vue files to React components: https://github.com/LukasBombach/single-file-components A .vue file can consist of a