-
-
Notifications
You must be signed in to change notification settings - Fork 668
Use Markdown.js with bootstrap.js #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I thought I'd tack one more on here while I was changing the webpack.mix.js file; hope thats ok. |
|
|
||
| if (mix.config.inProduction) { | ||
| mix.version(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why wouldn't you want to do this locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way the npm build command works you could still do versioning locally if you wanted; In Laravel Mix, mix.config.inProduction is an indicator if your running npm run production or npm run dev.
What this enables is npm run hot which provided by Laravel Mix, watches for file/css changes and then automatically rebuilds app.js or app.css file when they do change. The issue is if you use mix.version and npm run hot, you get chunk errors, this conditional fixes that.
So you can still run mix.version() locally by running npm run production.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks for the explanation. Any reason why this isn't in the mix file by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nvm. Just read the documentation for it.
|
Looks good 👌 Thanks for sending this in! |
driesvints
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job!
|
|
||
| if (mix.config.inProduction) { | ||
| mix.version(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nvm. Just read the documentation for it.
Fixes #267
Requiring just markdown like so
Includes a file like so
Which to the best of my knowledge exposes markdown as
require('markdown').markdownwhich requires the need to assign it to a variable and then to use it outside of the bundled code you'll want to assign it towindow.https://github.com/gjrdiesel/portal/blob/834d506705b88add765cef26280a5d86e01ab6a3/resources/assets/js/bootstrap.js#L62