question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using custom webpack loaders

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [X ] feature request

Versions.

1.4.3

Desired functionality.

I have to load a custom loader to process .graphql files, I’d like to be able to add custom loaders to webpack config.

Mention any other details that might be useful.

The rule I want to add is

/* File loader for graphql files.
*  Returns file content as string
*/
  {
     test: /\.(graphql|gql)$/,
     exclude: /node_modules/,
     loader: 'graphql-tag/loader'
  }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
filipesilvacommented, Oct 25, 2017

I know this is not the answer you wanted but truth is this has been extensively discussed before, and so this issue is a duplicate of https://github.com/angular/angular-cli/issues/1656. You can read there what the final word on that topic is for now.

5reactions
JohannesHoppecommented, Feb 7, 2018

@akeelnazir

I came around here, because I have the exact same use-case. I want to use the graphql-tag/loader but without the burden of ng eject. You can do this instead:

const myQuery = require('graphql-tag/loader!./myQuery.graphql');
Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing a custom webpack loader - Redd Developer
Using a custom loader ... There are two ways to use a loader: tell webpack to resolve it from a local file, or...
Read more >
Writing a Loader - webpack
A loader is a node module that exports a function. This function is called when a resource should be transformed by this loader....
Read more >
How to write a Webpack loader - Advanced Web Machinery
Webpack loaders offer a way to write any custom processing step between the source file and the result the frontend gets and it...
Read more >
Writing Webpack Loader - Gleb Bahmutov
Let's convert Markdown to HTML using Webpack and markdown-loader. ... using a custom local loader from a local file
Read more >
Generating code and the webpack loader
Custom webpack loaders are a powerful tool for handling special cases where you need some custom need for all files with a particular...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found