Last active
October 27, 2016 09:11
-
-
Save adrianhardy/703eef93bc0bdd84574f3a630196c79e to your computer and use it in GitHub Desktop.
Laravel / Brunch Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
conventions: { | |
assets: /(^resources\/assets\/static\/)/, | |
vendor: /(^bower_components|node_modules)\// | |
}, | |
paths: { | |
public: 'public/build', | |
watched: ['resources/assets/js'] | |
}, | |
files: { | |
javascripts: { | |
joinTo: { | |
'js/app.js': /^resources\/assets\/js/, | |
'js/vendor.js': /^node_modules/, | |
} | |
} | |
}, | |
plugins: { | |
babel: { | |
presets: ['es2015', 'react'], // 'es2016'? | |
plugins: ['transform-do-expressions'] | |
} | |
}, | |
modules: { | |
nameCleaner: path => path.replace('resources/assets/js/', '') | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elixir = require('laravel-elixir'); | |
/* | |
|-------------------------------------------------------------------------- | |
| Elixir Asset Management | |
|-------------------------------------------------------------------------- | |
| | |
| Elixir provides a clean, fluent API for defining some basic Gulp tasks | |
| for your Laravel application. By default, we are compiling the Sass | |
| file for your application as well as publishing vendor resources. | |
| | |
*/ | |
elixir((mix) => { | |
mix.sass('app.scss', 'public/build/css'); | |
mix.copy('node_modules/font-awesome/fonts', 'public/build/vendor/fonts'); | |
mix.styles([ | |
'font-awesome/css/font-awesome.css', | |
], 'public/build/vendor/css/common.css', 'node_modules'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Project", | |
"description": "", | |
"author": "", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"gulpprod": "gulp --production", | |
"gulpdev": "gulp watch", | |
"brunchdev": "brunch watch --server", | |
"brunchprod": "brunch build --production" | |
}, | |
"dependencies": { | |
"react": "~15.3.0", | |
"react-dom": "~15.3.0" | |
}, | |
"devDependencies": { | |
"auto-reload-brunch": "^2.0.0", | |
"babel-brunch": "~6.0.0", | |
"babel-preset-es2015": "~6.9.0", | |
"babel-preset-react": "~6.11.1", | |
"bootstrap-sass": "^3.3.7", | |
"brunch": "^2.4.0", | |
"font-awesome": "^4.7.0", | |
"gulp": "^3.9.1", | |
"javascript-brunch": "^2.0.0", | |
"jquery": "^3.1.0", | |
"laravel-elixir": "^6.0.0-11", | |
"laravel-elixir-webpack-official": "^1.0.2", | |
"lodash": "^4.16.2", | |
"uglify-js-brunch": "^2.0.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-- Add the following just before </body> --} | |
<div id="app"></div> <!-- react '<App>' container --> | |
<script type="text/javascript" src="{{ asset('build/js/vendor.js') }}"></script> | |
<script type="text/javascript" src="{{ asset('build/js/app.js') }}"></script> | |
<script type="text/javascript"> | |
require('initialize'); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment