Skip to content

Commit

Permalink
fix: 🐛 Implement new hot-reload plugin for all examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipoliko committed Dec 2, 2019
1 parent 3ed4502 commit cc5d7bf
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 22 deletions.
13 changes: 0 additions & 13 deletions packages/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions packages/create-ima-app/examples/feed/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ module.exports = (() => {
css: ['./build/static/css/app.css']
};

if (
process.env.NODE_ENV === 'dev' ||
process.env.NODE_ENV === 'development' ||
process.env.NODE_ENV === undefined
) {
vendors.common.push('@ima/plugin-websocket');
vendors.common.push('@ima/plugin-hot-reload');
}

return {
js,
mainjs,
Expand Down
9 changes: 9 additions & 0 deletions packages/create-ima-app/examples/hello/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ let bundle = {
css: ['./build/static/css/app.css']
};

if (
process.env.NODE_ENV === 'dev' ||
process.env.NODE_ENV === 'development' ||
process.env.NODE_ENV === undefined
) {
vendors.common.push('@ima/plugin-websocket');
vendors.common.push('@ima/plugin-hot-reload');
}

module.exports = {
js,
mainjs,
Expand Down
9 changes: 9 additions & 0 deletions packages/create-ima-app/examples/todos/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ let bundle = {
css: ['./build/static/css/app.css']
};

if (
process.env.NODE_ENV === 'dev' ||
process.env.NODE_ENV === 'development' ||
process.env.NODE_ENV === undefined
) {
vendors.common.push('@ima/plugin-websocket');
vendors.common.push('@ima/plugin-hot-reload');
}

module.exports = {
js,
mainjs,
Expand Down
10 changes: 6 additions & 4 deletions packages/create-ima-app/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
],
"license": "MIT",
"devDependencies": {
"@ima/gulp-task-loader": "17.0.0-rc.5",
"@ima/gulp-tasks": "17.0.0-rc.7",
"babel-eslint": "10.0.3",
"enzyme": "3.10.0",
"enzyme-adapter-react-16": "1.14.0",
Expand All @@ -28,20 +30,20 @@
"eslint-plugin-jest": "22.3.0",
"eslint-plugin-prettier": "3.1.0",
"eslint-plugin-react": "7.14.3",
"@ima/gulp-task-loader": "17.0.0-rc.5",
"@ima/gulp-tasks": "17.0.0-rc.7",
"jest": "24.9.0",
"prettier": "1.18.2"
},
"dependencies": {
"@ima/core": "17.0.0-rc.7",
"@ima/plugin-hot-reload": "0.1.0",
"@ima/plugin-websocket": "0.1.0",
"@ima/server": "17.0.0-rc.7",
"body-parser": "1.19.0",
"compression": "1.7.4",
"cookie-parser": "1.4.4",
"express": "4.17.1",
"express-http-proxy": "1.5.1",
"helmet": "3.20.1",
"@ima/core": "17.0.0-rc.7",
"@ima/server": "17.0.0-rc.7",
"method-override": "3.0.0",
"multer": "1.4.2",
"prop-types": "15.7.2",
Expand Down
5 changes: 4 additions & 1 deletion packages/gulp-tasks/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions packages/gulp-tasks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
},
"homepage": "https://github.com/seznam/ima",
"peerDependencies": {
"@ima/helpers": "^17.0.0"
"@ima/helpers": "^17.x",
"@ima/plugin-websocket": "^0.x"
},
"devDependencies": {
"@ima/helpers": "^17.0.0-rc.5"
"@ima/helpers": "^17.0.0-rc.5",
"@ima/plugin-websocket": "^0.1.0"
},
"dependencies": {
"@babel/core": "^7.5.5",
Expand All @@ -43,7 +45,6 @@
"@babel/polyfill": "^7.4.4",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"@ima/plugin-websocket": "^0.1.0",
"ansi-colors": "^3.2.3",
"autoprefixer": "^9.6.1",
"babel-plugin-react-prop-types-remover": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/gulp-tasks/tasks/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const gls = require('gulp-live-server');
const { createServer } = require('@ima/plugin-websocket/lib');
const { createServer } = require('@ima/plugin-websocket/server');

const sharedState = require('../gulpState.js');

Expand Down

0 comments on commit cc5d7bf

Please sign in to comment.