Socket
Socket
Sign inDemoInstall

@web/dev-server-rollup

Package Overview
Dependencies
Maintainers
6
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.0.2 to 0.1.0

20

CHANGELOG.md
# @web/dev-server-rollup
## 0.1.0
### Minor Changes
- c4cb321: Use web dev server in test runner. This contains multiple breaking changes:
- Browsers that don't support es modules are not supported for now. We will add this back later.
- Most es-dev-server config options are no longer available. The only options that are kept are `plugins`, `middleware`, `nodeResolve` and `preserveSymlinks`.
- Test runner config changes:
- Dev server options are not available on the root level of the configuration file.
- `nodeResolve` is no longer enabled by default. You can enable it with the `--node-resolve` flag or `nodeResolve` option.
- `middlewares` option is now called `middleware`.
- `testFrameworkImport` is now called `testFramework`.
- `address` is now split into `protocol` and `hostname`.
### Patch Changes
- Updated dependencies [c4cb321]
- @web/dev-server-core@0.1.0
## 0.0.2

@@ -4,0 +24,0 @@

4

dist/createRollupPluginContextAdapter.d.ts

@@ -1,4 +0,4 @@

import { Config, FSWatcher, Plugin as WdsPlugin, Context } from '@web/dev-server-core';
import { DevServerCoreConfig, FSWatcher, Plugin as WdsPlugin, Context } from '@web/dev-server-core';
import { PluginContext, MinimalPluginContext, TransformPluginContext } from 'rollup';
export declare function createRollupPluginContextAdapter<T extends PluginContext | MinimalPluginContext | TransformPluginContext>(pluginContext: T, wdsPlugin: WdsPlugin, config: Config, fileWatcher: FSWatcher, context: Context): T & {
export declare function createRollupPluginContextAdapter<T extends PluginContext | MinimalPluginContext | TransformPluginContext>(pluginContext: T, wdsPlugin: WdsPlugin, config: DevServerCoreConfig, fileWatcher: FSWatcher, context: Context): T & {
addWatchFile(id: string): void;

@@ -5,0 +5,0 @@ emitAsset(): never;

@@ -52,2 +52,12 @@ "use strict";

const rollupPluginContext = createRollupPluginContextAdapter_1.createRollupPluginContextAdapter(rollupPluginContexts.pluginContext, wdsPlugin, config, fileWatcher, context);
let resolvableImport = source;
let importSuffix = '';
// we have to special case node-resolve because it doesn't support resolving
// with hash/params at the moment
if (rollupPlugin.name === 'node-resolve') {
const [withoutHash, hash] = source.split('#');
const [importPath, params] = withoutHash.split('?');
importSuffix = `${params ? `?${params}` : ''}${hash ? `#${hash}` : ''}`;
resolvableImport = importPath;
}
// if the import was already a fully resolved file path, it was probably injected by a plugin.

@@ -58,4 +68,4 @@ // in that case use that instead of resolving it through a plugin hook. this puts the resolved file

const result = injectedFilePath
? source
: await ((_a = rollupPlugin.resolveId) === null || _a === void 0 ? void 0 : _a.call(rollupPluginContext, source, filePath));
? resolvableImport
: await ((_a = rollupPlugin.resolveId) === null || _a === void 0 ? void 0 : _a.call(rollupPluginContext, resolvableImport, filePath));
let resolvedImportFilePath = undefined;

@@ -80,14 +90,12 @@ if (typeof result === 'string') {

const prefixedImportPath = resolvedImportPath.startsWith('/') || resolvedImportPath.startsWith('.')
? resolvedImportPath
: `./${resolvedImportPath}`;
? `${resolvedImportPath}${importSuffix}`
: `./${resolvedImportPath}${importSuffix}`;
if (!hasNullByte) {
return prefixedImportPath;
}
else {
const suffix = `${NULL_BYTE_PARAM}=${encodeURIComponent(resolvedImportFilePath)}`;
if (prefixedImportPath.includes('?')) {
return `${prefixedImportPath}&${suffix}`;
}
return `${prefixedImportPath}?${suffix}`;
const suffix = `${NULL_BYTE_PARAM}=${encodeURIComponent(resolvedImportFilePath)}`;
if (prefixedImportPath.includes('?')) {
return `${prefixedImportPath}&${suffix}`;
}
return `${prefixedImportPath}?${suffix}`;
}

@@ -100,3 +108,3 @@ // if the resolved import includes a null byte (\0) there is some special logic

}
return resolvedImportFilePath;
return `${resolvedImportFilePath}${importSuffix}`;
},

@@ -103,0 +111,0 @@ async serve(context) {

{
"name": "@web/dev-server-rollup",
"version": "0.0.2",
"version": "0.1.0",
"publishConfig": {

@@ -41,4 +41,4 @@ "access": "public"

"dependencies": {
"@web/dev-server-core": "^0.0.3",
"rollup": "^2.18.2",
"@web/dev-server-core": "^0.1.0",
"rollup": "^2.20.0",
"whatwg-url": "^8.1.0"

@@ -45,0 +45,0 @@ },

@@ -24,5 +24,3 @@ # Dev Server Rollup

module.exports = {
plugins: [
wrapRollupPlugin(replace({ include: ['src/**/*.js'], __environment__: '"development"' })),
],
plugins: [rollupAdapter(replace({ include: ['src/**/*.js'], __environment__: '"development"' }))],
};

@@ -33,3 +31,3 @@ ```

Some rollup plugins do expensive operations. During development, this matters a lot more than during a production build. It's recommended to always scope the usage of plugins using the `include` and/or `exclude` options.
Some rollup plugins do expensive operations. During development, this matters a lot more than during a production build. It's recommended to always scope the usage of plugins using the `include` and/or `exclude` options available in most rollup plugins.

@@ -48,2 +46,3 @@ ## non-standard file types

name: 'json-mime-type-plugin',
resolveMimeType(context) {

@@ -55,2 +54,3 @@ if (context.path.endsWith('.json')) {

},
rollupAdapter(json()),

@@ -57,0 +57,0 @@ ],

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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