Skip to content

Commit bf13184

Browse files
author
Guillaume Chau
committed
Switch to launch-editor-middleware
1 parent 3d77274 commit bf13184

File tree

4 files changed

+73
-37
lines changed

4 files changed

+73
-37
lines changed

docs/open-in-editor.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,34 @@ Nuxt supports this feature out-of-the-box. Make sure to be in debug mode.
66

77
## Webpack
88

9-
In your Vue project, install the [express-open-in-editor](https://github.com/lahmatiy/express-open-in-editor) package and modifiy your webpack configuration:
9+
In your Vue project, install the [launch-editor-middleware](https://github.com/yyx990803/launch-editor#middleware) package and modifiy your webpack configuration:
1010

1111
1. Import the package:
1212

1313
```js
14-
var openInEditor = require('express-open-in-editor')
14+
var openInEditor = require('launch-editor-middleware')
1515
```
1616

1717
2. In the `devServer` option, register the `/__open-in-editor` HTTP route:
1818

1919
```js
2020
devServer: {
2121
before (app) {
22-
app.use('/__open-in-editor', openInEditor({
23-
editor: 'code'
24-
}))
22+
app.use('/__open-in-editor', openInEditor())
2523
}
2624
}
2725
```
2826

29-
3. You can change `'code'` with the editor you are using, see the [supported editors list](https://github.com/lahmatiy/open-in-editor#editor).
27+
3. The editor to launch is guessed. You can also specify the editor app with the `editor` option. See the [supported editors list](https://github.com/lahmatiy/open-in-editor#editor).
3028

31-
You can now click on the name of the component in the Component inspector pane (if the devtools knows about its file source, a tooltip will appear).
29+
```js
30+
openInEditor({
31+
editor: 'code'
32+
})
33+
```
34+
35+
4. You can now click on the name of the component in the Component inspector pane (if the devtools knows about its file source, a tooltip will appear).
3236

3337
## Node.js
3438

35-
You can use the [open-in-editor](https://github.com/lahmatiy/open-in-editor) package to setup an HTTP route with the `/__open-in-editor` path. It will receive `file` as an URL variable.
39+
You can use the [launch-editor](https://github.com/yyx990803/launch-editor#usage) package to setup an HTTP route with the `/__open-in-editor` path. It will receive `file` as an URL variable.

package-lock.json

Lines changed: 55 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
"css-loader": "^0.28.7",
4040
"eslint": "^4.13.1",
4141
"eslint-plugin-vue-libs": "^2.0.1",
42-
"express-open-in-editor": "^3.1.1",
4342
"file-loader": "^1.1.6",
4443
"friendly-errors-webpack-plugin": "^1.6.1",
44+
"launch-editor-middleware": "^1.0.0",
4545
"nightwatch": "^0.9.19",
4646
"nightwatch-helpers": "^1.2.0",
4747
"selenium-server": "2.52.0",

shells/dev/webpack.config.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
var path = require('path')
2-
var webpack = require('webpack')
31
var alias = require('../alias')
42
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
5-
var openInEditor = require('express-open-in-editor')
3+
var openInEditor = require('launch-editor-middleware')
64

75
var bubleOptions = {
86
target: { chrome: 52, firefox: 48 },
@@ -19,7 +17,7 @@ module.exports = {
1917
output: {
2018
path: __dirname + '/build',
2119
publicPath: '/build/',
22-
filename: '[name].js',
20+
filename: '[name].js'
2321
},
2422
resolve: {
2523
alias
@@ -28,7 +26,7 @@ module.exports = {
2826
rules: [
2927
{
3028
test: /\.js$/,
31-
loader: 'buble-loader',
29+
loader: 'buble-loader',
3230
exclude: /node_modules|vue\/dist|vuex\/dist/,
3331
options: bubleOptions
3432
},
@@ -53,10 +51,8 @@ module.exports = {
5351
devServer: {
5452
quiet: true,
5553
before (app) {
56-
app.use('/__open-in-editor', openInEditor({
57-
editor: 'code'
58-
}))
54+
app.use('/__open-in-editor', openInEditor())
5955
}
6056
},
61-
plugins: process.env.VUE_DEVTOOL_TEST ? [] :[new FriendlyErrorsPlugin()]
57+
plugins: process.env.VUE_DEVTOOL_TEST ? [] : [new FriendlyErrorsPlugin()]
6258
}

0 commit comments

Comments
 (0)