Socket
Socket
Sign inDemoInstall

@web/dev-server-rollup

Package Overview
Dependencies
Maintainers
7
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web/dev-server-rollup - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

9

CHANGELOG.md
# @web/dev-server-rollup
## 0.3.1
### Patch Changes
- 375116ad: fix handling of paths resolved outside the root dir. we now correctly use the resolved path when resolving relative imports and when populating the transform cache
- 2f205878: handle null bytes in HTML
- Updated dependencies [375116ad]
- @web/dev-server-core@0.3.2
## 0.3.0

@@ -4,0 +13,0 @@

9

dist/rollupAdapter.js

@@ -65,2 +65,8 @@ "use strict";

var _a;
if (context.response.is('html') && source.startsWith('�')) {
// when serving HTML a null byte gets parsed as an unknown character
// we remap it to a null byte here so that it is handled properly downstream
// this isn't a perfect solution
source = source.replace('�', '\0');
}
// if we just transformed this file and the import is an absolute file path

@@ -76,4 +82,3 @@ // we need to rewrite it to a browser path

}
const requestedFile = context.path.endsWith('/') ? `${context.path}index.html` : context.path;
const filePath = path_1.default.join(rootDir, requestedFile);
const filePath = dev_server_core_1.getRequestFilePath(context, rootDir);
try {

@@ -80,0 +85,0 @@ const rollupPluginContext = createRollupPluginContextAdapter_1.createRollupPluginContextAdapter(rollupPluginContexts.pluginContext, wdsPlugin, config, fileWatcher, context, pluginMetaPerModule);

{
"name": "@web/dev-server-rollup",
"version": "0.3.0",
"version": "0.3.1",
"publishConfig": {

@@ -50,3 +50,3 @@ "access": "public"

"dependencies": {
"@web/dev-server-core": "^0.3.0",
"@web/dev-server-core": "^0.3.2",
"chalk": "^4.1.0",

@@ -66,3 +66,3 @@ "parse5": "^6.0.1",

"@types/whatwg-url": "^8.0.0",
"@web/test-runner-chrome": "^0.8.0",
"@web/test-runner-chrome": "^0.8.1",
"@web/test-runner-core": "^0.9.0",

@@ -69,0 +69,0 @@ "chai": "^4.2.0",

@@ -101,2 +101,9 @@ /* eslint-disable no-control-regex */

async resolveImport({ source, context, code, column, line }) {
if (context.response.is('html') && source.startsWith('�')) {
// when serving HTML a null byte gets parsed as an unknown character
// we remap it to a null byte here so that it is handled properly downstream
// this isn't a perfect solution
source = source.replace('�', '\0');
}
// if we just transformed this file and the import is an absolute file path

@@ -114,4 +121,3 @@ // we need to rewrite it to a browser path

const requestedFile = context.path.endsWith('/') ? `${context.path}index.html` : context.path;
const filePath = path.join(rootDir, requestedFile);
const filePath = getRequestFilePath(context, rootDir);

@@ -118,0 +124,0 @@ try {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc