Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build_production/
/build_local/
/node_modules/
/vendor/
Expand Down
28 changes: 13 additions & 15 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
{
"scripts": {
"dev": "npm run compile-css-js && ./vendor/bin/jigsaw build",
"compile-css-js": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-js": "chokidar 'source/_assets/js/**/*' --initial=true -c 'npm run compile-css-js'",
"watch-css": "chokidar 'tailwind.js' 'source/_assets/less/**/*' --initial=true -c 'npm run compile-css-js'",
"watch-templates": "chokidar 'source/**/*' --initial=true -c './vendor/bin/jigsaw build'",
"watch": "concurrently \"npm run watch-css\" \"npm run watch-js\" \"npm run watch-templates\"",
"prod": "npm run production && ./vendor/bin/jigsaw build production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
"local": "cross-env NODE_ENV=development webpack --progress --hide-modules --env=local --config=node_modules/laravel-mix/setup/webpack.config.js",
"staging": "cross-env NODE_ENV=development webpack --progress --hide-modules --env=staging --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "cross-env NODE_ENV=development webpack --progress --hide-modules --env=production --config=node_modules/laravel-mix/setup/webpack.config.js",
"dev": "npm run local",
"prod": "npm run production",
"watch": "npm run local -- --watch"
},
"private": true,
"devDependencies": {
"anchor-js": "^4.1.0",
"cross-env": "^3.2.3",
"escape-html": "^1.0.3",
"laravel-mix": "^1.5.1",
"prismjs": "^1.8.3",
"vue": "^2.5.2"
},
"dependencies": {
"chokidar-cli": "^1.2.0",
"concurrently": "^3.5.0",
"less": "^2.7.2",
"less-loader": "^4.0.5",
"lodash": "^4.17.4",
"node-cmd": "^3.0.0",
"normalize.css": "^7.0.0",
"on-build-webpack": "^0.1.0",
"postcss-cssnext": "^3.0.2",
"stylefmt": "^6.0.0"
"prismjs": "^1.8.3",
"stylefmt": "^6.0.0",
"vue": "^2.5.2",
"webpack-watch": "^0.2.0",
"yargs": "^10.0.3"
},
"browserslist": [
"> 1%"
Expand Down
2 changes: 2 additions & 0 deletions docs/source/_layouts/master.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</head>
<body data-sidebar-visible="true" class="font-sans font-normal text-slate-darker leading-normal">
@yield('body')
@if ($page->production)
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-109068504-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
Expand All @@ -31,5 +32,6 @@ function gtag(){dataLayer.push(arguments);}

gtag('config', 'UA-109068504-1');
</script>
@endif
</body>
</html>
19 changes: 18 additions & 1 deletion docs/webpack.mix.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
const argv = require('yargs').argv
const command = require('node-cmd')
const mix = require('laravel-mix')
const OnBuild = require('on-build-webpack')
const Watch = require('webpack-watch')
const tailwind = require('./../lib/index.js')
const config = require('./../defaultConfig.js')
const fs = require('fs')


fs.writeFileSync('./tailwind.json', JSON.stringify(config))

const env = argv.e || argv.env || 'local'
const plugins = [
new OnBuild(() => {
command.get('./vendor/bin/jigsaw build ' + env, (error, stdout, stderr) => {
console.log(error ? stderr : stdout)
})
}),
new Watch({
paths: ['source/**/*.md', 'source/**/*.php'],
options: { ignoreInitial: true }
}),
]

mix.webpackConfig({ plugins })
mix.setPublicPath('source')

mix
Expand Down
Loading