
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
react-static-plugin-raw-loader
Advanced tools
A React-Static pulgin that allows importing files as a String.
A React-Static plugin that allows importing files as a String.
$ npm install react-static-plugin-raw-loader
# or
$ yarn add react-static-plugin-raw-loader
Edit your static.config.js
, add this plugin like this:
export default {
// ...
plugins: [
// ...
'react-static-plugin-raw-loader'
]
// ...
};
Now you can import raw text as a String from *.txt
file or *.md
file.
import React from 'react'
import textValue from 'something.txt'
const App = function() {
return (
<div>
<p>{textValue}</p>
<div/>
);
};
For Typescript user, you may need type declaration. Save this as yourcustomfilename.d.ts
, and you can place it anywhere in your typescript project to take effect.
declare module "*.txt" {
const content: string;
export default content;
}
declare module "*.md" {
const content: string;
export default content;
}
As you can see from its README, raw-loader has been "deprecated" since Webpack v5 has added support for importing asset files (see asset modules ).
But React-Static are using Webpack v4 at present. So this dependency may become no longer necessary when React-Static uses Webpack v5 in the future.
FAQs
A React-Static pulgin that allows importing files as a String.
The npm package react-static-plugin-raw-loader receives a total of 0 weekly downloads. As such, react-static-plugin-raw-loader popularity was classified as not popular.
We found that react-static-plugin-raw-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.