Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract watcher into its own package #2176

Merged
merged 1 commit into from
Oct 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ coverage
.nyc_output
.cache
dist
lib
.vscode/
.idea/
*.min.js
Expand Down
1 change: 1 addition & 0 deletions packages/core/parcel-bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"tomlify-j0.4": "^3.0.0",
"v8-compile-cache": "^2.0.0",
"ws": "^5.1.1",
"@parcel/watcher": "1.10.3",
"@parcel/workers": "^1.10.3",
"@parcel/logger": "^1.10.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/parcel-bundler/src/Bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const Parser = require('./Parser');
const WorkerFarm = require('@parcel/workers');
const Path = require('path');
const Bundle = require('./Bundle');
const Watcher = require('./Watcher');
const Watcher = require('@parcel/watcher');
const FSCache = require('./FSCache');
const HMRServer = require('./HMRServer');
const Server = require('./Server');
Expand Down
13 changes: 13 additions & 0 deletions packages/core/watcher/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "6"
}
}
]
],
"plugins": ["@babel/plugin-transform-runtime"]
}
5 changes: 5 additions & 0 deletions packages/core/watcher/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Node 8 supports native async functions - no need to use compiled code!
module.exports =
parseInt(process.versions.node, 10) < 8
? require('./lib/Watcher')
: require('./src/Watcher');
18 changes: 18 additions & 0 deletions packages/core/watcher/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@parcel/watcher",
"version": "1.10.3",
"description": "Blazing fast, zero configuration web application bundler",
"main": "index.js",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/parcel-bundler/parcel.git"
},
"scripts": {
"build": "babel src -d lib",
"prepublish": "yarn build"
},
"dependencies": {
"fswatcher-child": "^1.0.5"
}
}