Build docs entirely in mix/webpack, no separate watching
This commit is contained in:
parent
33b7e94f26
commit
a35f77edf8
3 changed files with 87 additions and 129 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue