mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Specify build input and output on the command line
This commit is contained in:
+3
-3
File diff suppressed because one or more lines are too long
+4
-6
@@ -2,17 +2,15 @@ import * as f from './flags'
|
||||
import { gulp as g, postcss as s } from './plugins'
|
||||
import { sync as glob } from 'glob'
|
||||
|
||||
const main = 'src'
|
||||
const entry = 'tgui.styl'
|
||||
const out = 'assets'
|
||||
|
||||
import gulp from 'gulp'
|
||||
export function css () {
|
||||
return gulp.src(`${main}/${entry}`)
|
||||
return gulp.src(`${f.src}/${entry}`)
|
||||
.pipe(g.if(f.debug, g.sourcemaps.init({loadMaps: true})))
|
||||
.pipe(g.stylus({
|
||||
url: 'data-url',
|
||||
paths: [main]
|
||||
paths: [f.src]
|
||||
}))
|
||||
.pipe(g.postcss([
|
||||
s.autoprefixer({ browsers: ['last 2 versions', 'ie >= 9'] }),
|
||||
@@ -28,8 +26,8 @@ export function css () {
|
||||
.pipe(g.if(f.min, g.cssnano()))
|
||||
.pipe(g.if(f.debug, g.sourcemaps.write()))
|
||||
.pipe(g.bytediff.stop())
|
||||
.pipe(gulp.dest(out))
|
||||
.pipe(gulp.dest(f.dest))
|
||||
}
|
||||
export function watch_css () {
|
||||
return gulp.watch(`${main}/**.styl`, css)
|
||||
return gulp.watch(`${f.src}/**.styl`, css)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
const flags = require('minimist')(process.argv.slice(2))
|
||||
|
||||
export const src = flags.src || 'src'
|
||||
export const dest = flags.dest || 'assets'
|
||||
|
||||
export const debug = flags.debug || flags.d
|
||||
export const min = flags.min || flags.m
|
||||
|
||||
+4
-6
@@ -2,9 +2,7 @@ import * as f from './flags'
|
||||
import { browserify as b, gulp as g } from './plugins'
|
||||
import { sync as glob } from 'glob'
|
||||
|
||||
const main = 'src'
|
||||
const entry = 'tgui.js'
|
||||
const out = 'assets'
|
||||
|
||||
import { transform as babel } from 'babel-core'
|
||||
import { readFileSync as read } from 'fs'
|
||||
@@ -24,11 +22,11 @@ b.componentify.compilers['text/stylus'] = function (source, file) {
|
||||
}
|
||||
|
||||
import browserify from 'browserify'
|
||||
const bundle = browserify(`${main}/${entry}`, {
|
||||
const bundle = browserify(`${f.src}/${entry}`, {
|
||||
debug: f.debug,
|
||||
cache: {},
|
||||
extensions: ['.js', '.ract'],
|
||||
paths: [main]
|
||||
paths: [f.src]
|
||||
})
|
||||
.plugin(b.rememberify)
|
||||
.transform(b.babelify)
|
||||
@@ -52,10 +50,10 @@ export function js () {
|
||||
.pipe(g.if(f.min, g.uglify({mangle: true, compress: {unsafe: true}})))
|
||||
.pipe(g.if(f.debug, g.sourcemaps.write()))
|
||||
.pipe(g.bytediff.stop())
|
||||
.pipe(gulp.dest(out))
|
||||
.pipe(gulp.dest(f.dest))
|
||||
}
|
||||
export function watch_js () {
|
||||
return gulp.watch(`${main}/**.js`, vinyl => {
|
||||
return gulp.watch(`${f.src}/**.js`, vinyl => {
|
||||
b.rememberify.forget(bundle, vinyl.path)
|
||||
return js()
|
||||
})
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<ui-notice>
|
||||
<span>Forks should place their interfaces in the interfaces/[fork] folder.</span>
|
||||
<span>They can be referenced as [fork]/[interface].</span>
|
||||
</ui-notice>
|
||||
Reference in New Issue
Block a user