Skip to content

Instantly share code, notes, and snippets.

@nulpatrol
Last active January 6, 2018 14:10
Show Gist options
  • Save nulpatrol/12361baed992c4c4c18135b70f09c3ee to your computer and use it in GitHub Desktop.
Save nulpatrol/12361baed992c4c4c18135b70f09c3ee to your computer and use it in GitHub Desktop.
Only front-end for SPA
{
"scripts": {
"dev": "NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"hot": "NODE_ENV=development webpack-dev-server --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
}
}
mkdir my-app && cd my-app
npm init -y
npm install laravel-mix --save-dev
cp -r node_modules/laravel-mix/setup/webpack.mix.js ./
mkdir -p resources/assets/js && mkdir -p resources/assets/sass
cd resources/assets/sass && touch app.js && cd ../js && touch app.scss
const { mix } = require('laravel-mix');
mix.setPublicPath('public/');
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css')
.version();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment