mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 18:24:03 +00:00
add landing page
This commit is contained in:
parent
38593e61a2
commit
ad38cd3982
113 changed files with 55463 additions and 13952 deletions
19
docs/tasks/bin.js
Normal file
19
docs/tasks/bin.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
var hasbin = require('hasbin');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
module.exports = {
|
||||
path: function() {
|
||||
if (fs.existsSync('./vendor/bin/jigsaw')) {
|
||||
return path.normalize('./vendor/bin/jigsaw')
|
||||
}
|
||||
|
||||
if (hasbin.sync('jigsaw')) {
|
||||
return 'jigsaw';
|
||||
}
|
||||
|
||||
console.log('Could not find Jigsaw; please install it via Composer, either locally or globally.');
|
||||
|
||||
process.exit();
|
||||
}
|
||||
};
|
||||
48
docs/tasks/build.js
Normal file
48
docs/tasks/build.js
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
let argv = require('yargs').argv;
|
||||
let bin = require('./bin');
|
||||
let command = require('node-cmd');
|
||||
|
||||
let BrowserSync = require('browser-sync');
|
||||
let BrowserSyncPlugin = require('browser-sync-webpack-plugin');
|
||||
let ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin');
|
||||
|
||||
let browserSyncInstance;
|
||||
let env = argv.e || argv.env || 'local';
|
||||
let port = argv.p || argv.port || 3000;
|
||||
|
||||
module.exports = {
|
||||
jigsaw: {
|
||||
apply(compiler) {
|
||||
compiler.hooks.done.tap('DonePlugin', (compilation) => {
|
||||
command.get(bin.path() + ' build -q ' + env, (error, stdout, stderr) => {
|
||||
console.log(error ? stderr : stdout);
|
||||
|
||||
if (browserSyncInstance) {
|
||||
browserSyncInstance.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
watch: function (paths) {
|
||||
return new ExtraWatchWebpackPlugin({
|
||||
files: paths,
|
||||
});
|
||||
},
|
||||
|
||||
browserSync: function (proxy) {
|
||||
return new BrowserSyncPlugin({
|
||||
notify: false,
|
||||
port: port,
|
||||
proxy: proxy,
|
||||
server: proxy ? null : { baseDir: 'build_' + env + '/' },
|
||||
},
|
||||
{
|
||||
reload: false,
|
||||
callback: function() {
|
||||
browserSyncInstance = BrowserSync.get('bs-webpack-plugin');
|
||||
},
|
||||
})
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue