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

es2015 update to env, dev server #33

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
26 changes: 13 additions & 13 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
}
},
"rules": {
"comma-dangle": [2, "always-multiline"],
"default-case": 1,
"dot-notation": 1,
"no-cond-assign": 1,
"no-constant-condition": 2,
"no-eval": 2,
"no-extend-native": 2,
"no-fallthrough": 2,
"no-lone-blocks": 1,
"no-loop-func": 1,
"no-redeclare": 1,
"no-unused-vars": 1,
"no-use-before-define": 0
"comma-dangle": [2, "always-multiline"],
"default-case": 1,
"dot-notation": 1,
"no-cond-assign": 1,
"no-constant-condition": 2,
"no-eval": 2,
"no-extend-native": 2,
"no-fallthrough": 2,
"no-lone-blocks": 1,
"no-loop-func": 1,
"no-redeclare": 1,
"no-unused-vars": 1,
"no-use-before-define": 0
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Copy image-resize.min.js into your web root or include from node_modules
```

```javascript
Quill.register('modules/imageResize', window.ImageResize.default);
var quill = new Quill(editor, {
// ...
modules: {
Expand Down
6 changes: 0 additions & 6 deletions demo/script.js

This file was deleted.

49 changes: 49 additions & 0 deletions dev-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
var webpackConfig = require('./webpack.config')
var opn = require('opn')
var path = require('path')
var express = require('express')
var webpack = require('webpack')

// default port where dev server listens for incoming traffic
var port = process.env.PORT || 9878
var app = express()
var compiler = webpack(webpackConfig)

var devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: '/',
quiet: true
})


// serve webpack bundle output
app.use(devMiddleware)

// enable hot-reload and state-preserving
// compilation error display
app.use(require("webpack-hot-middleware")(compiler));

// serve pure static assets
app.use('/', express.static('./'))

var uri = 'http://localhost:' + port

var _resolve
var readyPromise = new Promise(resolve => {
_resolve = resolve
})

console.log('> Starting dev server...')
devMiddleware.waitUntilValid(() => {
console.log('> Listening at ' + uri + '\n')
opn(uri)
_resolve()
})

var server = app.listen(port)

module.exports = {
ready: readyPromise,
close: () => {
server.close()
}
}
Loading