Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Update webpack-dev-server & babel version in TeX examples (#1981)
Browse files Browse the repository at this point in the history
Summary:
**Summary**
* Upgrade `webpack-dev-server` to 3.1.14 to fix [vulnerability in versions < 3.1.11](https://nvd.nist.gov/vuln/detail/CVE-2018-14732) & `webpack` to 4.0.0 to match it
* Upgrade `babel` to 6.0.0 & `babel-loader` to 7.0.0 to match `webpack` upgrade
* Changes to `server.js` & `app.js` to support the `webpack` & `babel` version upgrades

**Test Plan**
Run `yarn start` and load http://localhost:3000/
<img width="1089" alt="screenshot 2019-01-21 13 22 30" src="https://user-images.githubusercontent.com/2357761/51502558-5974d780-1d8b-11e9-8568-917f43967188.png">
Pull Request resolved: #1981

Reviewed By: claudiopro

Differential Revision: D13754649

Pulled By: claudiopro

fbshipit-source-id: 19169f9b091d85344d975e2d7b963437b7701e9b
  • Loading branch information
niveditc authored and facebook-github-bot committed Jan 22, 2019
1 parent 363f66e commit a3a3585
Show file tree
Hide file tree
Showing 8 changed files with 5,568 additions and 1,528 deletions.
1 change: 0 additions & 1 deletion examples/draft-0-10-0/tex/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

'use strict';

import 'babel/polyfill';
import TeXEditorExample from './components/TeXEditorExample';
import React from 'react';
import ReactDOM from 'react-dom';
Expand Down
8 changes: 4 additions & 4 deletions examples/draft-0-10-0/tex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"start": "babel-node ./server.js"
},
"dependencies": {
"babel": "5.8.23",
"babel": "6.0.0",
"babel-core": "^6.8.0",
"babel-loader": "^6.2.4",
"babel-loader": "^7.0.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"draft-js": "file:../../../",
Expand All @@ -15,8 +15,8 @@
"katex": "^0.5.1",
"react": "file:../../../node_modules/react",
"react-dom": "file:../../../node_modules/react-dom",
"webpack": "^1.10.5",
"webpack-dev-server": "^1.10.1"
"webpack": "^4.0.0",
"webpack-dev-server": "^3.1.14"
},
"devDependencies": {
"babel-cli": "^6.18.0"
Expand Down
7 changes: 4 additions & 3 deletions examples/draft-0-10-0/tex/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ const APP_PORT = 3000;
var compiler = webpack({
entry: path.resolve(__dirname, 'js', 'app.js'),
module: {
loaders: [
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
loader: 'babel-loader',
options: {
presets: ['es2015', 'react'],
},
},
],
},
output: {filename: 'app.js', path: '/'},
mode: 'development',
});
var app = new WebpackDevServer(compiler, {
contentBase: '/public/',
Expand Down
Loading

0 comments on commit a3a3585

Please sign in to comment.