Skip to content

Commit 4a88334

Browse files
Merge pull request #4 from laravel-frontend-presets/chore/update-for-inertia-0.1
Update the frontend preset for InertiaJS 0.1
2 parents fc0fbc4 + 8c0b6c8 commit 4a88334

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
],
1313
"require": {
1414
"laravel/framework": "^5.8",
15-
"inertiajs/inertia-laravel": "dev-master"
15+
"inertiajs/inertia-laravel": "^0.1"
1616
},
1717
"require-dev": {
1818
"orchestra/testbench": "^3.8"

src/InertiaJsPreset.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,14 @@ protected static function updatePackageArray(array $packages)
2323
{
2424
return array_merge([
2525
'@babel/plugin-syntax-dynamic-import' => '^7.2.0',
26-
'inertia' => 'github:inertiajs/inertia',
27-
'inertia-vue' => 'inertiajs/inertia-vue',
26+
'@inertiajs/inertia' => '^0.1.0',
27+
'@inertiajs/inertia-vue' => '^0.1.0',
2828
'vue-template-compiler' => '^2.6.10',
2929
], $packages);
3030
}
3131

3232
protected static function updateBootstrapping()
3333
{
34-
copy(__DIR__.'/inertiajs-stubs/.babelrc', base_path('.babelrc'));
35-
3634
copy(__DIR__.'/inertiajs-stubs/webpack.mix.js', base_path('webpack.mix.js'));
3735

3836
copy(__DIR__.'/inertiajs-stubs/resources/js/app.js', resource_path('js/app.js'));

src/inertiajs-stubs/.babelrc

-3
This file was deleted.

src/inertiajs-stubs/resources/js/app.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
require('./bootstrap')
22

3-
import Inertia from 'inertia-vue'
3+
import { InertiaApp } from '@inertiajs/inertia-vue'
44
import Vue from 'vue'
55

6-
Vue.use(Inertia)
6+
Vue.use(InertiaApp)
77

88
let app = document.getElementById('app')
99

1010
new Vue({
11-
render: h => h(Inertia, {
11+
render: h => h(InertiaApp, {
1212
props: {
1313
initialPage: JSON.parse(app.dataset.page),
1414
resolveComponent: (name) => {

src/inertiajs-stubs/webpack.mix.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
const mix = require('laravel-mix')
22
const path = require('path')
33

4-
mix.sass('resources/sass/app.scss', 'public/css')
5-
.js('resources/js/app.js', 'public/js').webpackConfig({
6-
output: { chunkFilename: 'js/[name].[contenthash].js' },
4+
mix.js('resources/js/app.js', 'public/js')
5+
.sass('resources/sass/app.scss', 'public/css')
6+
.webpackConfig({
7+
output: { chunkFilename: 'js/[name].js?id=[chunkhash]' },
78
resolve: {
89
alias: {
9-
'vue$': 'vue/dist/vue.runtime.js',
10+
'vue$': 'vue/dist/vue.runtime.esm.js',
1011
'@': path.resolve('resources/js'),
1112
},
1213
},
1314
})
15+
.babelConfig({
16+
plugins: ['@babel/plugin-syntax-dynamic-import']
17+
})

0 commit comments

Comments
 (0)