Skip to content

Commit

Permalink
Extract watcher into its own package
Browse files Browse the repository at this point in the history
  • Loading branch information
padmaia committed Oct 19, 2018
1 parent af06ce9 commit 7c7cff6
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
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
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
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
@@ -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
@@ -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
@@ -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"
}
}
File renamed without changes.

0 comments on commit 7c7cff6

Please sign in to comment.