24
loading...
This website collects cookies to deliver better user experience
Host: 127.0.0.1
Username: root
Password: leave blank
composer create-project craftcms/craft your-project-name
Database driver | mysql |
Database server | 127.0.0.1 |
Database port | 3306 |
Database username | root |
Database password | leave blank |
Database name | Craft |
Database table prefix | leave blank |
Username | daafbleumink |
info@daafbleumink.com | |
Password | SuperSecret |
Site name | Craft CMS Test |
Site URL | https://tutorial.test |
Site language | nl |
valet secure tutorial
npm init -y
npm install laravel-mix --save-dev
touch webpack.mix.js
webpack.mix.js
.// webpack.mix.js
let mix = require('laravel-mix');
mix.js('src/app.js', 'dist').setPublicPath('dist');
src/app.js
and save it to the /dist
directory.src/app.js
file with some basic (valid) code.// src/app.js
alert('hello world');
npx mix
npx mix
everytime. Here are the basic scripts I use. Add these to the scripts
section of your package.json
and you should be good to go.// package.json
"scripts": {
"dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
},
webpack.mix.js
file for starter projects. It includes:// webpack.mix.js
let mix = require('laravel-mix');
let domain = 'tutorial.test';
let homedir = require('os').homedir();
require('mix-tailwindcss');
mix
.js('src/app.js', 'dist')
.vue()
.extract(['vue'])
.setPublicPath('dist');
mix
.sass('src/scss/app.scss', '/')
.tailwind('./tailwind.config.js');
mix.browserSync({
proxy: 'https://' + domain,
host: domain,
open: 'external',
browser: 'Brave Browser', // or Chrome / Safari for example
https: {
key: homedir + '/.config/valet/Certificates/' + domain + '.key',
cert: homedir + '/.config/valet/Certificates/' + domain + '.crt',
},
notify: false
});
// only version the files in production
if (mix.inProduction()) {
mix.version();
}