Skip to content

Commit

Permalink
fix(travis-build): add frontend build in travis and remove webpack-st…
Browse files Browse the repository at this point in the history
…ats (#189)

* fix(travis-build): add frontend build in travis and remove webpack-stats.json

* fix(travis-build): fix configs for production build
  • Loading branch information
fristonio authored and gupta-utkarsh committed Mar 18, 2018
1 parent 8fe080d commit d48c512
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -36,7 +36,7 @@ api/migrations/*
!api/migrations/__init__.py

# Bundle
django_server/static/bundles/local
django_server/static/bundles

# Python
*.pyc
Expand All @@ -47,3 +47,6 @@ origami.env

# package-lock.json as we use yarn for dependency management
package-lock.json

# Webpack stats
webpack-stats-local.json
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -33,6 +33,7 @@ install:
- yarn install

script:
- npm run build
- python manage.py makemigrations
- python manage.py migrate
- python manage.py test
Expand Down
2 changes: 1 addition & 1 deletion django_server/settings.py
Expand Up @@ -161,7 +161,7 @@

WEBPACK_LOADER = {
'DEFAULT': {
'BUNDLE_DIR_NAME': 'bundles/local/', # end with slash
'BUNDLE_DIR_NAME': 'bundles/', # end with slash
'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats-local.json'),
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -3,8 +3,8 @@
"version": "1.0.0",
"description": "Create a demo of your machine learning model with CloudCV",
"scripts": {
"remove:bundle": "node_modules/.bin/rimraf ./django_server/static/bundles/local",
"clean:bundle": "npm-run-all remove:bundle && mkdir ./django_server/static/bundles/local",
"remove:bundle": "node_modules/.bin/rimraf ./django_server/static/bundles",
"clean:bundle": "npm-run-all remove:bundle && mkdir ./django_server/static/bundles",
"build": "npm-run-all clean:bundle test lint:build && babel-node Origami/scripts/build.js",
"start": "babel-node server.js",
"open:src": "babel-node server.js",
Expand Down
1 change: 0 additions & 1 deletion webpack-stats-local.json

This file was deleted.

2 changes: 1 addition & 1 deletion webpack.base.config.js
Expand Up @@ -11,7 +11,7 @@ module.exports = {
},

output: {
path: path.resolve("./django_server/static/bundles/local/"),
path: path.resolve("./django_server/static/bundles/"),
filename: "[name]-[hash].js"
},

Expand Down
2 changes: 1 addition & 1 deletion webpack.local.config.js
Expand Up @@ -15,7 +15,7 @@ const config = {
},
target: "web",
output: {
path: path.resolve("./django_server/static/bundles/local/"),
path: path.resolve("./django_server/static/bundles/"),
publicPath: "http://localhost:3000/static/bundles/",
filename: "bundle.js"
},
Expand Down
4 changes: 1 addition & 3 deletions webpack.prod.config.js
Expand Up @@ -10,9 +10,7 @@ const config = {
entry: "./Origami/src/index",
target: "web",
output: {
path: path.resolve(
path.join(__dirname, "django_server/static/bundles/local/")
),
path: path.resolve(path.join(__dirname, "django_server/static/bundles/")),
filename: "bundle.js"
},
plugins: [
Expand Down

0 comments on commit d48c512

Please sign in to comment.