AKSW/building-navigator

Using just the dist-folder isn't working (BuildingNavigator is not defined)

Closed this issue · 11 comments

k00ni commented

I copied the dist folder to my webhosting and wanted to use the index.html. But after calling it in the browser i ran into the following exceptions:

Uncaught Invariant Violation: Minified React error #37; 
visit http://facebook.github.io/react/docs/error-decoder.html?invariant=37 
for the full message or use the non-minified dev environment for full 
errors and additional helpful warnings.

Uncaught ReferenceError: BuildingNavigator is not defined

Generated main.min.js does NOT contain BuildingNavigator. Any idea?

screenshot from 2017-01-10 15 48 24

Should solved with latest commit 17e6db3 (it was an old main.min.js)

k00ni commented

Do you update dist/main.min.js on file changes or do i have to do that manually?

k00ni commented

Many steps neccessary? Can we move that into a Makefile or something to reduce the time load?

k00ni commented

But I don't think it's a good idea the recreate the dist with each new commit

Why not? The dist folder should be valid and contain the latest changes. If we want to carry out packages, which update only after days/weeks/months ... we could use Github's release section. But i wanted to use the dist from the beginning, to be able to try out the app without any further work.

Could you sketch here how it should work to update dist-folder manually, by calling like make update-dist. On each Git commit sounds hard to implement.

177bf27 implements command npm build-dist. It has to executed in the running Docker container.

k00ni commented

Thanks! Will look into it.

k00ni commented

Please use this for round 3.

package.json:

"devDependencies": {
        ...
        "write-file-webpack-plugin": "*"
    }

webpack.config.json:

...
var WriteFilePlugin = require('write-file-webpack-plugin');

module.exports = {
    ...
    output: {
        ...
    },
    plugins: [
        new WriteFilePlugin() // plugin to write compiled JS into dist folder
    ],
    ...
}

As I pointed out the disadvantages of using WriteFilePlugin (esp. js min size) we may close this issue?

To build dist on each commit/push we can create a pre-push hook as a reminder or programmatically create dist and append to commit.

k00ni commented

As we decided we use two configurations, dev and prod, for future releases.