diff --git a/assets/js/app.js b/assets/js/app.js index 48930b3e..53499990 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1,8 +1,11 @@ import 'alpinejs' import '../css/app.pcss' +import turbolinks from 'turbolinks' window.hljs = require('highlightjs') let html = document.documentElement html.classList.remove('no-js') html.classList.add('js') + +turbolinks.start() diff --git a/package-lock.json b/package-lock.json index e0638294..90ccb164 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1053,9 +1053,9 @@ }, "dependencies": { "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==" + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==" } } }, @@ -8607,6 +8607,11 @@ "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=" }, + "turbolinks": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/turbolinks/-/turbolinks-5.2.0.tgz", + "integrity": "sha512-pMiez3tyBo6uRHFNNZoYMmrES/IaGgMhQQM+VFF36keryjb5ms0XkVpmKHkfW/4Vy96qiGW3K9bz0tF5sK9bBw==" + }, "type": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", diff --git a/package.json b/package.json index c48dd688..e254d405 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "tailwindcss-interaction-variants": "^2.2.0", "tailwindcss-skip-link": "^1.0.1", "tailwindcss-spaced-items": "^0.1.0", - "tailwindcss-visuallyhidden": "^1.0.2" + "tailwindcss-visuallyhidden": "^1.0.2", + "turbolinks": "^5.2.0" }, "devDependencies": { "eslint": "^5.15.3", diff --git a/webpack.config.js b/webpack.config.js index 61bc6a4a..a1bedcd3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,12 +12,13 @@ Encore .configureLoaderRule('css', loaderRule => { loaderRule.test = /\.(css|p(ost)?css)$/ }) - .enableSourceMaps(!Encore.isProduction()) if (Encore.isProduction()) { Encore .enableVersioning() .addPlugin(new PurgecssPlugin(purgecssConfig)) +} else { + Encore.enableSourceMaps() } module.exports = Encore.getWebpackConfig()