diff options
Diffstat (limited to 'tasks')
| -rw-r--r-- | tasks/bin.js | 19 | ||||
| -rw-r--r-- | tasks/build.js | 48 |
2 files changed, 0 insertions, 67 deletions
diff --git a/tasks/bin.js b/tasks/bin.js deleted file mode 100644 index 32fcbea..0000000 --- a/tasks/bin.js +++ /dev/null @@ -1,19 +0,0 @@ -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(); - } -}; diff --git a/tasks/build.js b/tasks/build.js deleted file mode 100644 index 836960d..0000000 --- a/tasks/build.js +++ /dev/null @@ -1,48 +0,0 @@ -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'); - }, - }) - }, -}; |
