Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@vavra7/compiler
Advanced tools
It runs Webpack under the hood to bundle application. Client part and server part allowing React to be server side rendered.
Readme
It runs Webpack under the hood to bundle application. Client part and server part allowing React to be server side rendered.
SSR React app written in Typescript
compiler dev
compiler build
compiler build -a
.
├── dist
│ ├── bundles.json
│ ├── index.js
│ └── static
│ ├── js
│ │ ├── main.js
│ │ ├── main.js.gz
│ │ ├── react.js
│ │ └── react.js.gz
│ └── media
│ └── 6576f3a9a340ac02328d.jpg
├── node_modules
├── public
│ └── favicon.ico
├── src
│ ├── assets
│ │ └── media
│ │ └── logo.jpg
│ ├── index.client.tsx
│ ├── index.server.tsx
│ └── root.tsx
├── .compilerrc.ts
├── package.json
└── tsconfig.json
Optional configuration file.
import { RunCommands } from '@vavra7/compiler';
const runCommands: RunCommands = {
features: {
emotions: true,
styledComponents: false
},
webpackClient: (config) => config,
webpackServer: (config) => config,
};
export default runCommands;
import type { FC } from 'react';
import React from 'react';
const Root: FC = () => {
return (
<>
<img alt="logo" className="App-logo" src={require('./assets/media/logo.jpg')} />
<div>Root of React application.</div>
</>
);
};
export default Root;
import fs from 'node:fs';
import path from 'node:path';
import express from 'express';
import React from 'react';
import { renderToString } from 'react-dom/server';
import Root from './root';
const app = express();
const bundles = JSON.parse(fs.readFileSync(path.join(__dirname, './bundles.json'), 'utf-8'));
app.use('/', express.static(path.join(__dirname, '../public')));
app.use(
'/static',
(req, res, next) => {
if (req.originalUrl.match(/^\/static\/js\/.*.js$/)) {
req.url = req.url + '.gz';
res.set('Cache-Control', 'max-age=31536000');
res.set('Content-Encoding', 'gzip');
res.set('Content-Type', 'text/javascript');
}
next();
},
express.static(path.join(__dirname, './static'))
);
app.use('*', (req, res) => {
const app = <Root />;
const markup = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="${bundles['main.js']}" defer></script>
<script src="${bundles['react.js']}" defer></script>
<title>Document</title>
</head>
<body>
<div id="root-container">
${renderToString(app)}
</div>
</body>
</html>
`;
res.setHeader('Content-Type', 'text/html');
res.end(markup);
});
app.listen(3000, () => console.log('Server is listening on http://localhost:3000'));
import React from 'react';
import { createRoot } from 'react-dom/client';
import Root from './root';
if (module?.hot) module.hot.accept();
const container = document.getElementById('root-container');
const root = createRoot(container!);
root.render(<Root />);
https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/725
FAQs
It runs Webpack under the hood to bundle application. Client part and server part allowing React to be server side rendered.
The npm package @vavra7/compiler receives a total of 0 weekly downloads. As such, @vavra7/compiler popularity was classified as not popular.
We found that @vavra7/compiler 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.