Using just the dist-folder isn't working (BuildingNavigator is not defined)
Closed this issue · 11 comments
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?
Should solved with latest commit 17e6db3 (it was an old main.min.js)
Do you update dist/main.min.js
on file changes or do i have to do that manually?
Many steps neccessary? Can we move that into a Makefile or something to reduce the time load?
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.
Thanks! Will look into it.
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.
As we decided we use two configurations, dev and prod, for future releases.