rollup-plugin-serve
Advanced tools
Comparing version 0.6.1 to 1.0.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [1.0.0] - 2019-01-11 | ||
### Fixed | ||
- Update `ongenerate` to `generateBundle` | ||
### Removed | ||
- Remove built-in `favicon.ico` #20 | ||
## [0.6.1] - 2018-12-23 | ||
@@ -54,3 +61,6 @@ ### Added | ||
[Unreleased]: https://github.com/thgh/rollup-plugin-serve/compare/v0.1.0...HEAD | ||
[Unreleased]: https://github.com/thgh/rollup-plugin-serve/compare/v1.0.0...HEAD | ||
[1.0.0]: https://github.com/thgh/rollup-plugin-serve/compare/v0.6.1...v1.0.0 | ||
[0.6.1]: https://github.com/thgh/rollup-plugin-serve/compare/v0.5.0...v0.6.1 | ||
[0.5.0]: https://github.com/thgh/rollup-plugin-serve/compare/v0.4.2...v0.5.0 | ||
[0.4.2]: https://github.com/thgh/rollup-plugin-serve/compare/v0.4.1...v0.4.2 | ||
@@ -57,0 +67,0 @@ [0.4.1]: https://github.com/thgh/rollup-plugin-serve/compare/v0.4.0...v0.4.1 |
@@ -44,18 +44,7 @@ 'use strict'; | ||
'\n\n' + filePath + | ||
'\n\n' + Object.keys(error).map(function (k) { | ||
return error[k] | ||
}).join('\n') + | ||
'\n\n' + Object.values(error).join('\n') + | ||
'\n\n(rollup-plugin-serve)', 'utf-8'); | ||
return | ||
} | ||
if (request.url === '/favicon.ico') { | ||
filePath = path.resolve(__dirname, '../dist/favicon.ico'); | ||
fs.readFile(filePath, function (error, content) { | ||
if (error) { | ||
notFound(response, filePath); | ||
} else { | ||
found(response, filePath, content); | ||
} | ||
}); | ||
} else if (options.historyApiFallback) { | ||
if (options.historyApiFallback) { | ||
var fallbackPath = typeof options.historyApiFallback === 'string' ? options.historyApiFallback : '/index.html'; | ||
@@ -93,3 +82,3 @@ readFileFromContentBase(options.contentBase, fallbackPath, function (error, content, filePath) { | ||
name: 'serve', | ||
ongenerate: function ongenerate () { | ||
generateBundle: function generateBundle () { | ||
if (!running) { | ||
@@ -140,3 +129,3 @@ running = true; | ||
function found (response, filePath, content) { | ||
response.writeHead(200, { 'Content-Type': mime.lookup(filePath) }); | ||
response.writeHead(200, { 'Content-Type': mime.getType(filePath) }); | ||
response.end(content, 'utf-8'); | ||
@@ -143,0 +132,0 @@ } |
@@ -40,18 +40,7 @@ import { readFile } from 'fs'; | ||
'\n\n' + filePath + | ||
'\n\n' + Object.keys(error).map(function (k) { | ||
return error[k] | ||
}).join('\n') + | ||
'\n\n' + Object.values(error).join('\n') + | ||
'\n\n(rollup-plugin-serve)', 'utf-8'); | ||
return | ||
} | ||
if (request.url === '/favicon.ico') { | ||
filePath = resolve(__dirname, '../dist/favicon.ico'); | ||
readFile(filePath, function (error, content) { | ||
if (error) { | ||
notFound(response, filePath); | ||
} else { | ||
found(response, filePath, content); | ||
} | ||
}); | ||
} else if (options.historyApiFallback) { | ||
if (options.historyApiFallback) { | ||
var fallbackPath = typeof options.historyApiFallback === 'string' ? options.historyApiFallback : '/index.html'; | ||
@@ -89,3 +78,3 @@ readFileFromContentBase(options.contentBase, fallbackPath, function (error, content, filePath) { | ||
name: 'serve', | ||
ongenerate: function ongenerate () { | ||
generateBundle: function generateBundle () { | ||
if (!running) { | ||
@@ -136,3 +125,3 @@ running = true; | ||
function found (response, filePath, content) { | ||
response.writeHead(200, { 'Content-Type': mime.lookup(filePath) }); | ||
response.writeHead(200, { 'Content-Type': mime.getType(filePath) }); | ||
response.end(content, 'utf-8'); | ||
@@ -139,0 +128,0 @@ } |
{ | ||
"name": "rollup-plugin-serve", | ||
"version": "0.6.1", | ||
"version": "1.0.0", | ||
"description": "Serve your rolled up bundle", | ||
@@ -9,6 +9,7 @@ "main": "dist/index.cjs.js", | ||
"scripts": { | ||
"build": "rollup -c -f cjs -o dist/index.cjs.js && rollup -c -f es -o dist/index.es.js", | ||
"dev": "rollup -cw -f cjs -o dist/index.cjs.js", | ||
"lint": "standard rollup.config.js src/**", | ||
"prepare": "npm run build" | ||
"build": "rollup -c", | ||
"dev": "rollup -cw", | ||
"lint": "standard --fix rollup.config.js src/**", | ||
"prepare": "yarn lint && yarn build", | ||
"test": "cd test && rollup -c || cd .." | ||
}, | ||
@@ -36,9 +37,10 @@ "keywords": [ | ||
"dependencies": { | ||
"mime": "^1.3.6", | ||
"opener": "^1.4.3" | ||
"mime": "2", | ||
"opener": "1" | ||
}, | ||
"devDependencies": { | ||
"rollup": "^0.48.2", | ||
"rollup-plugin-buble": "^0.15.0" | ||
"rollup": "1", | ||
"rollup-plugin-buble": "^0.15.0", | ||
"standard": "12" | ||
} | ||
} |
@@ -21,3 +21,7 @@ # Rollup plugin to serve the bundle | ||
``` | ||
# Rollup v0.60+ and v1+ | ||
npm install --save-dev rollup-plugin-serve | ||
# Rollup v0.59 and below | ||
npm install --save-dev rollup-plugin-serve@0 | ||
``` | ||
@@ -31,3 +35,3 @@ | ||
export default { | ||
input: 'entry.js', | ||
input: 'src/main.js', | ||
output: { | ||
@@ -34,0 +38,0 @@ file: 'dist/bundle.js', |
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
122
4
15809
3
6
242
+ Addedmime@2.6.0(transitive)
- Removedmime@1.6.0(transitive)
Updatedmime@2
Updatedopener@1