Laravel/Vue.js JSON dependency file
Hey everyone, I hope you're well.
So - I have a Laravel app, that captures form data on submission of a form. The data from the form is really messy, so, I basically just shoved all of the data into a database row, and then I use Vue/Laravel to sort the data when it needs to be presented to my customer to analyse it.
I thought a better way to do this, was to have an hourly artisan command, that would output a JSON file so that Vue can rifle through it without Laravel having to do anything.
This works great locally, but I can't get it to deploy via DeployHQ.
My webpack.mix.js:
resolve: {
alias: {
"@": path.resolve(
__dirname,
"./storage/app/public/"
)
}
}
});
And the file where the JSON file is referenced:
import Scores from '@/scores.json';
When DeployHQ runs my npm run build task, it just fails, with the following error message:
This dependency was not found:
* @/scores.json in ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/partials/Dashboard.vue?vue&type=script&lang=js&
To install it, you can run: npm install --save @/scores.json
As you can see, the scores.json file exists within the storage directory, but not when the app is built and pushed to the server by DeployHQ.
How on earth do I get around this?
Please or to participate in this conversation.